summaryrefslogtreecommitdiff
path: root/src/bot/commands/util/info.ts
blob: ad783b5f0c65bf9e8ad4f1b2c38a515870f4ec57 (plain) (blame)
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
56
57
58
59
60
61
62
import { stripIndents } from 'common-tags';
import { Command, PrefixSupplier } from 'discord-akairo';
import { Message } from 'discord.js';

export default class InfoCommand extends Command {
	public constructor() {
		super('info', {
			aliases: ['guide', 'about', 'info'],
			clientPermissions: ['SEND_MESSAGES'],
			description: {
				content: 'Gives information about the bot.',
			},
			category: 'Utilities',
		});
	}

	public async exec(msg: Message): Promise<Message | Message[]> {
		// const prefix = (this.handler.prefix as PrefixSupplier)(msg);
		const prefix = 'w$';
		const embed = this.client.util
			.embed()
			.setColor(this.client.config.color)
			.setAuthor(`${this.client.user!.username} Guide`, this.client.user!.displayAvatarURL())
			.addField(
				'**Prerequisites**',
				stripIndents`
				• Invite the bot.
				• Ensure the bot has the permissions \`Manage Messages\`, \`Send Messages\`, and \`Add Reactions\`.
				• If you plan on creating a Reaction Role, you must have the \`Manage Roles\` permissions.
				• My highest role must be above the role you want to assign upon reaction.
			`,
			)
			.addField(
				'**Setup**',
				stripIndents`
				The format for a reaction role is as follows: **\`${prefix} new <type> <channel> <message ID> <emoji> <role>\`**.
				The \`type\` representes what kind of reaction role you'd like to create. If you specify \`1\`, it will be a classic react to add, unreact to remove. \`2\` is a react to add only and vice versa with \`3\`.
				The \`channel\` represents the text channel of the message you want to setup the reaction role on.
				The \`message ID\` represents the ID of the message you want to configure the reaction role on.
				The \`emoji\` represents the emoji that users must react with to recieve or get the role removed.
				And lastly, the \`role\` is the role you want to apply or remove.

				\* If you don't to provide all the arguments at once, you can run \`${prefix}new\` alone and use the Reaction Role Builder™.
				\* When running the command, don't include the <>'s
				\* Some emojis may not be compatible. All Guild emojis and only single-code unicode emojis may work.
			`,
			)
			.addField(
				'**Deletion**',
				stripIndents`
				If you'd like to delete an existing reaction role, you can:
				a) delete the message the reaction role is on
				b) run \`${prefix}del <ID>\` (the ID provided when you made the Reaction Role)
			`,
			)
			.setDescription(stripIndents`
				${this.client.user!.username} is a Discord bot to create reaction-based role assignment.
				When a user reacts to a message that has a live message reaction, they will be applied or given the configured role.	
			`);
		return msg.util!.send({ embed });
	}
}