From 20bcaab8fc8c157a4f106f4188813b6685281a7c Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sat, 8 Sep 2018 02:18:56 +0000 Subject: [PATCH] Doors Command --- README.md | 3 ++- commands/games/doors.js | 32 ++++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 commands/games/doors.js diff --git a/README.md b/README.md index ec695b44..9581bb7d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Xiao is a Discord bot coded in JavaScript with The bot is no longer available for invite. You can self-host the bot, or use her on the [home server](https://discord.gg/sbMe32W). -## Commands (303) +## Commands (304) ### Utility: * **eval:** Executes JavaScript code. @@ -200,6 +200,7 @@ on the [home server](https://discord.gg/sbMe32W). * **box-choosing:** Do you believe that there are choices in life? Taken from Higurashi Chapter 4. * **captcha-quiz:** Try to guess what the captcha says. * **chance:** Attempt to win with a 1 in 1000 (or your choice) chance of winning. +* **doors:** Open the right door, and you win the money! Make the wrong one, and you get the fire! * **emoji-emoji-revolution:** Can you type arrow emoji faster than anyone else has ever typed them before? * **fishy:** Go fishing. * **google-feud:** Attempt to determine the top suggestions for a Google search. diff --git a/commands/games/doors.js b/commands/games/doors.js new file mode 100644 index 00000000..ec04cf33 --- /dev/null +++ b/commands/games/doors.js @@ -0,0 +1,32 @@ +const Command = require('../../structures/Command'); +const { stripIndents } = require('common-tags'); + +module.exports = class DoorsCommand extends Command { + constructor(client) { + super(client, { + name: 'doors', + aliases: ['door', 'door-opening', 'open-door'], + group: 'games', + memberName: 'doors', + description: 'Open the right door, and you win the money! Make the wrong one, and you get the fire!', + args: [ + { + key: 'door', + prompt: 'Which door number do you want to pick? A number from 1-3.', + type: 'integer', + min: 1, + max: 3 + } + ] + }); + } + + run(msg, { door }) { + const win = Math.floor(Math.random() * 3) + 1; + const emoji = door === win ? '💰' : '🔥'; + return msg.reply(stripIndents` + ${door === win ? 'You chose wisely.' : 'Hmm... Try again.'} + ${door === 1 ? emoji : '🚪'} ${door === 2 ? emoji : '🚪'} ${door === 3 ? emoji : '🚪'} + `); + } +}; diff --git a/package.json b/package.json index 6f03e567..b0f0796b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "90.5.0", + "version": "90.6.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {