From f426a022f8eb2415b3e74d6f68a113ba63b849f3 Mon Sep 17 00:00:00 2001 From: kry008 Date: Thu, 30 May 2024 11:36:41 +0200 Subject: [PATCH] Add 8ball command for yes or no responses --- commands/8ball.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 commands/8ball.js diff --git a/commands/8ball.js b/commands/8ball.js new file mode 100644 index 0000000..02f04bc --- /dev/null +++ b/commands/8ball.js @@ -0,0 +1,34 @@ +function eightBall() { + //yes - 999:2000 + //no - 999:2000 + //maybe - 1:1000 + var rand = Math.floor(Math.random() * 3000); + if(rand < 1000) { + return "Yes"; + } else if(rand < 2000) { + return "No"; + } else { + return "Maybe"; + } +} + +module.exports = { + name: '8ball', + description: 'Yes or No?', + help: 'Yes or No?', + options: [], + slash: true, + text: true, + admin: false, + requireKick: false, + requireBan: false, + canBeUsedInDm: true, + contexts: ['GUILD_TEXT', 'GUILD_VOICE', 'DM'], + integration_types: [0,1], + execute(message, args) { + message.channel.send(eightBall()); + }, + executeSlash(interaction) { + interaction.reply(eightBall()); + }, +};