diff --git a/README.md b/README.md index d7505d8d..d56a4880 100644 --- a/README.md +++ b/README.md @@ -261,7 +261,7 @@ in the appropriate channel's topic to use it. ## Commands -Total: 579 +Total: 580 ### Utility: @@ -363,6 +363,7 @@ Total: 579 * **this-for-that:** So, basically, it's like a bot command for this dumb meme. * **word:** Responds with a random word. * **xiao-fact:** Responds with a random fact about Xiao. +* **yes-no:** Answers a yes/no question randomly. * **yo-mama:** Responds with a random "Yo Mama" joke. ### Random Image: diff --git a/commands/random-res/yes-no.js b/commands/random-res/yes-no.js new file mode 100644 index 00000000..5c223791 --- /dev/null +++ b/commands/random-res/yes-no.js @@ -0,0 +1,30 @@ +const Command = require('../../structures/Command'); +const { stripIndents } = require('common-tags'); +const answers = ['Yes', 'No']; + +module.exports = class YesNoCommand extends Command { + constructor(client) { + super(client, { + name: 'yes-no', + aliases: ['y-n'], + group: 'random-res', + memberName: 'yes-no', + description: 'Answers a yes/no question randomly.', + args: [ + { + key: 'question', + prompt: 'What do you want to get an answer for?', + type: 'string', + max: 1950 + } + ] + }); + } + + run(msg, { question }) { + return msg.say(stripIndents` + ${question} + ${answers[Math.floor(Math.random() * answers.length)]} + `); + } +}; diff --git a/package.json b/package.json index 5469a525..2412ce2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "126.7.0", + "version": "126.8.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {