Skip to content

Commit

Permalink
feat(command): add game category
Browse files Browse the repository at this point in the history
* Add game category which includes...
- `/8ball` - funny ball lol
- `/bet` - bet your virtual money
- `/coin-flip` - flip a coin for some reason"
  • Loading branch information
tinarskii committed Nov 6, 2022
1 parent 5c6550c commit f9a83bf
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/commands/game/8ball.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
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),
],
});
}
}
Empty file added src/commands/game/bet.ts
Empty file.
Empty file added src/commands/game/coin-flip.ts
Empty file.
Empty file added src/commands/misc/bot-stats.ts
Empty file.
Empty file added src/commands/misc/info.ts
Empty file.

0 comments on commit f9a83bf

Please sign in to comment.