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
|
import { ApplicationCommandOptionType } from 'discord-api-types';
import { Role } from 'discord.js';
import { BushCommand } from '../../lib/extensions/BushCommand';
import { BushMessage } from '../../lib/extensions/BushMessage';
import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';
import AllowedMentions from '../../lib/utils/AllowedMentions';
export default class MuteRoleCommand extends BushCommand {
constructor() {
super('muteRole', {
aliases: ['muterole'],
category: 'config',
description: {
content: 'Configure what role to use when muting users.',
usage: 'prefix [prefix]',
examples: ['prefix', 'prefix +']
},
clientPermissions: ['SEND_MESSAGES'],
userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'],
args: [
{
id: 'role',
type: 'role',
prompt: {
start: "What would you like to set the server's mute role to?",
retry: '{error} Choose a valid role.',
optional: false
}
}
],
slash: true,
slashOptions: [
{
type: ApplicationCommandOptionType.ROLE,
name: 'role',
description: "What would you like to set the server's mute role to?",
required: true
}
]
});
}
async exec(message: BushMessage | BushSlashMessage, args: { role: Role }): Promise<void> {
await message.guild.setSetting('muteRole', args.role.id);
await message.util.send({
content: `${this.client.util.emojis.success} Changed the server's mute role to <@&${args.role.id}>.`,
allowedMentions: AllowedMentions.none()
});
}
}
|