aboutsummaryrefslogtreecommitdiff
path: root/src/commands/fun/dice.ts
blob: 9f186570d5a68fd51d6a82ccb63d998e856e0328 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { BushCommand, BushMessage, BushSlashMessage } from '@lib';

export default class EightBallCommand extends BushCommand {
	public constructor() {
		super('dice', {
			aliases: ['dice', 'die'],
			category: 'fun',
			description: {
				content: 'Roll virtual dice.',
				usage: 'dice',
				examples: ['dice']
			},
			clientPermissions: (m) => util.clientSendAndPermCheck(m),
			userPermissions: [],
			slash: true
		});
	}

	public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> {
		const responses = ['1', '2', '3', '4', '5', '6'];
		const answer = responses[Math.floor(Math.random() * responses.length)];
		return await message.util.reply(`You rolled a **${answer}**.`);
	}
}