mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 14:19:56 +02:00
Will You Press the Button? and Word Commands
This commit is contained in:
@@ -136,7 +136,7 @@ in the appropriate channel's topic to use it.
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
Total: 420
|
Total: 422
|
||||||
|
|
||||||
### Utility:
|
### Utility:
|
||||||
|
|
||||||
@@ -212,6 +212,8 @@ Total: 420
|
|||||||
* **the-onion:** Responds with a random "The Onion" article.
|
* **the-onion:** Responds with a random "The Onion" article.
|
||||||
* **this-for-that:** So, basically, it's like a bot command for this dumb meme.
|
* **this-for-that:** So, basically, it's like a bot command for this dumb meme.
|
||||||
* **waifu:** Responds with a randomly generated waifu and backstory.
|
* **waifu:** Responds with a randomly generated waifu and backstory.
|
||||||
|
* **will-you-press-the-button:** Responds with a random "Will You Press The Button?" dilemma.
|
||||||
|
* **word:** Responds with a random word.
|
||||||
* **would-you-rather:** Responds with a random "Would you rather ...?" question.
|
* **would-you-rather:** Responds with a random "Would you rather ...?" question.
|
||||||
* **xiao-fact:** Responds with a random fact about Xiao.
|
* **xiao-fact:** Responds with a random fact about Xiao.
|
||||||
|
|
||||||
@@ -845,6 +847,7 @@ here.
|
|||||||
* read-qr-code ([QR code API](http://goqr.me/api/))
|
* read-qr-code ([QR code API](http://goqr.me/api/))
|
||||||
- [Grady Ward](https://en.wikipedia.org/wiki/Grady_Ward)
|
- [Grady Ward](https://en.wikipedia.org/wiki/Grady_Ward)
|
||||||
* hangman ([Moby Word Lists](http://www.gutenberg.org/ebooks/3201))
|
* hangman ([Moby Word Lists](http://www.gutenberg.org/ebooks/3201))
|
||||||
|
* word ([Moby Word Lists](http://www.gutenberg.org/ebooks/3201))
|
||||||
* word-chain ([Moby Word Lists](http://www.gutenberg.org/ebooks/3201))
|
* word-chain ([Moby Word Lists](http://www.gutenberg.org/ebooks/3201))
|
||||||
- [Gravatar](https://en.gravatar.com/)
|
- [Gravatar](https://en.gravatar.com/)
|
||||||
* gravatar ([API](https://en.gravatar.com/site/implement/))
|
* gravatar ([API](https://en.gravatar.com/site/implement/))
|
||||||
@@ -1243,6 +1246,8 @@ here.
|
|||||||
* itunes ([Language Code Data](https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes))
|
* itunes ([Language Code Data](https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes))
|
||||||
* time ([Time Zone Data](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones))
|
* time ([Time Zone Data](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones))
|
||||||
* wikipedia ([API](https://en.wikipedia.org/w/api.php))
|
* wikipedia ([API](https://en.wikipedia.org/w/api.php))
|
||||||
|
- [Will You Press The Button?](https://willyoupressthebutton.com/)
|
||||||
|
* will-you-press-the-button (Dilemma Data)
|
||||||
- [www.aljanh.net](http://www.aljanh.net/)
|
- [www.aljanh.net](http://www.aljanh.net/)
|
||||||
* frame ([Image](http://www.aljanh.net/frame-wallpapers/1508614706.html))
|
* frame ([Image](http://www.aljanh.net/frame-wallpapers/1508614706.html))
|
||||||
- [xertris](https://www.deviantart.com/xertris)
|
- [xertris](https://www.deviantart.com/xertris)
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
const Command = require('../../structures/Command');
|
||||||
|
const request = require('node-superfetch');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
|
module.exports = class WillYouPressTheButtonCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'will-you-press-the-button',
|
||||||
|
aliases: ['press-the-button', 'button', 'wyptb', 'press-button'],
|
||||||
|
group: 'random-res',
|
||||||
|
memberName: 'will-you-press-the-button',
|
||||||
|
description: 'Responds with a random "Will You Press The Button?" dilemma.',
|
||||||
|
credit: [
|
||||||
|
{
|
||||||
|
name: 'Will You Press The Button?',
|
||||||
|
url: 'https://willyoupressthebutton.com/',
|
||||||
|
reason: 'Dilemma Data'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(msg) {
|
||||||
|
try {
|
||||||
|
const { text } = await request.get('https://willyoupressthebutton.com/');
|
||||||
|
const $ = cheerio.load(text, { normalizeWhitespace: true });
|
||||||
|
const cond = $('div[id="cond"]').first().text().trim();
|
||||||
|
const res = $('div[id="res"]').first().text().trim();
|
||||||
|
return msg.say(`**${cond}** but **${res}**`);
|
||||||
|
} catch (err) {
|
||||||
|
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
const Command = require('../../structures/Command');
|
||||||
|
const words = require('../../assets/json/word-list');
|
||||||
|
|
||||||
|
module.exports = class WordCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'word',
|
||||||
|
aliases: ['random-word'],
|
||||||
|
group: 'random-res',
|
||||||
|
memberName: 'word',
|
||||||
|
description: 'Responds with a random word.',
|
||||||
|
credit: [
|
||||||
|
{
|
||||||
|
name: 'Grady Ward',
|
||||||
|
url: 'https://en.wikipedia.org/wiki/Grady_Ward',
|
||||||
|
reason: 'Moby Word Lists',
|
||||||
|
reasonURL: 'http://www.gutenberg.org/ebooks/3201'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
run(msg) {
|
||||||
|
const word = words[Math.floor(Math.random() * words.length)];
|
||||||
|
return msg.reply(word.toLowerCase());
|
||||||
|
}
|
||||||
|
};
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "114.12.0",
|
"version": "114.13.0",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user