Will You Press the Button? and Word Commands

This commit is contained in:
Dragon Fire
2020-05-17 21:39:07 -04:00
parent 2d7c4c6f46
commit a85fcee021
4 changed files with 68 additions and 2 deletions
+6 -1
View File
@@ -136,7 +136,7 @@ in the appropriate channel's topic to use it.
## Commands
Total: 420
Total: 422
### Utility:
@@ -212,6 +212,8 @@ Total: 420
* **the-onion:** Responds with a random "The Onion" article.
* **this-for-that:** So, basically, it's like a bot command for this dumb meme.
* **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.
* **xiao-fact:** Responds with a random fact about Xiao.
@@ -845,6 +847,7 @@ here.
* read-qr-code ([QR code API](http://goqr.me/api/))
- [Grady Ward](https://en.wikipedia.org/wiki/Grady_Ward)
* 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))
- [Gravatar](https://en.gravatar.com/)
* 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))
* time ([Time Zone Data](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones))
* 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/)
* frame ([Image](http://www.aljanh.net/frame-wallpapers/1508614706.html))
- [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!`);
}
}
};
+27
View File
@@ -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
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "114.12.0",
"version": "114.13.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {