aboutsummaryrefslogtreecommitdiff
path: root/src/commands/fun/eightBall.ts
blob: be9c7b5fcee1cecdc3008d91c85017f42eb54d44 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { BotCommand, clientSendAndPermCheck, type CommandMessage, type SlashMessage } from '#lib';
import { ApplicationCommandOptionType } from 'discord.js';

export default class EightBallCommand extends BotCommand {
	public constructor() {
		super('eightBall', {
			aliases: ['eightball', '8ball'],
			category: 'fun',
			description: 'Ask questions for a randomly generated response.',
			usage: ['eightball <question>'],
			examples: ['eightball does anyone love me?'],
			args: [
				{
					id: 'question',
					description: 'The question to have answered.',
					type: 'string',
					match: 'rest',
					prompt: 'What question would you like answered?',
					retry: '{error} Invalid question.',
					slashType: ApplicationCommandOptionType.String
				}
			],
			slash: true,
			clientPermissions: (m) => clientSendAndPermCheck(m),
			userPermissions: []
		});
	}

	public override async exec(message: CommandMessage | SlashMessage) {
		const responses = [
			'It is certain',
			'Without a doubt',
			'You may rely on it',
			'Yes definitely',
			'It is decidedly so',
			'As I see it, yes',
			'Most likely',
			'Yes',
			'Outlook good',
			'Signs point to yes',
			'Reply hazy try again',
			'Better not tell you now',
			'Ask again later',
			'Cannot predict now',
			'Concentrate and ask again',
			"Don't count on it",
			'Outlook not so good',
			'My sources say no',
			'Very doubtful',
			'My reply is no'
		];
		const answer = responses[Math.floor(Math.random() * responses.length)];
		await message.util.reply(answer);
	}
}