Doors Command

This commit is contained in:
Daniel Odendahl Jr
2018-09-08 02:18:56 +00:00
parent 70ede4db62
commit 20bcaab8fc
3 changed files with 35 additions and 2 deletions
+2 -1
View File
@@ -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.
+32
View File
@@ -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 : '🚪'}
`);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "90.5.0",
"version": "90.6.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {