From f9a83bf153276df9150934bb37a426e96ddc1e9a Mon Sep 17 00:00:00 2001 From: tinarskii Date: Sun, 6 Nov 2022 13:17:24 +0700 Subject: [PATCH] feat(command): add game category * Add game category which includes... - `/8ball` - funny ball lol - `/bet` - bet your virtual money - `/coin-flip` - flip a coin for some reason" --- src/commands/game/8ball.ts | 42 ++++++++++++++++++++++++++++++++++ src/commands/game/bet.ts | 0 src/commands/game/coin-flip.ts | 0 src/commands/misc/bot-stats.ts | 0 src/commands/misc/info.ts | 0 5 files changed, 42 insertions(+) create mode 100644 src/commands/game/8ball.ts create mode 100644 src/commands/game/bet.ts create mode 100644 src/commands/game/coin-flip.ts create mode 100644 src/commands/misc/bot-stats.ts create mode 100644 src/commands/misc/info.ts diff --git a/src/commands/game/8ball.ts b/src/commands/game/8ball.ts new file mode 100644 index 0000000..9cc74bd --- /dev/null +++ b/src/commands/game/8ball.ts @@ -0,0 +1,42 @@ +import { Discord, Slash, SlashOption } from "discordx"; +import { ApplicationCommandOptionType, Colors, CommandInteraction, EmbedBuilder } from "discord.js"; +import { Category } from "@discordx/utilities"; + +@Discord() +@Category("Game") +export class Magic8Ball { + @Slash({ description: "Ask a question to the magic 8 ball", name: "8ball" }) + async magic8ball( + @SlashOption({ + description: "Question to ask", + name: "question", + type: ApplicationCommandOptionType.String, + required: true, + }) + question: string, + interaction: CommandInteraction, + ): Promise { + const answers = [ + "Signs point to yes.", + "Yes.", + "Reply hazy, try again.", + "Without a doubt.", + "My sources say no.", + "As I see it, yes.", + "You may rely on it.", + "Concentrate and ask again.", + "Outlook not so good.", + "It is decidedly so.", + "Better not tell you now.", + ]; + + await interaction.reply({ + embeds: [ + new EmbedBuilder() + .setTitle("Magic 8 Ball") + .setDescription(`**Question:** ${question}\n**Answer:** ${answers[Math.floor(Math.random() * answers.length)]}`) + .setColor(Colors.Blue), + ], + }); + } +} \ No newline at end of file diff --git a/src/commands/game/bet.ts b/src/commands/game/bet.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/commands/game/coin-flip.ts b/src/commands/game/coin-flip.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/commands/misc/bot-stats.ts b/src/commands/misc/bot-stats.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/commands/misc/info.ts b/src/commands/misc/info.ts new file mode 100644 index 0000000..e69de29