aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/lockdown.ts
blob: db074b1df36b2d05283eefd7db77a317db0faa43 (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
import { BushCommand, BushMessage, BushNewsChannel, BushSlashMessage, BushTextChannel } from '@lib';

export default class LockdownCommand extends BushCommand {
	public constructor() {
		super('lockdown', {
			aliases: ['lockdown', 'unlockdown'],
			category: 'moderation',
			description: {
				content: 'Allows you to lockdown a channel or all configured channels..',
				usage: 'lockdown [--all]',
				examples: ['lockdown', 'lockdown --all']
			},
			args: [
				{
					id: 'all',
					type: 'flag',
					flag: '--all'
				}
			],
			slash: true,
			slashOptions: [
				{
					name: 'all',
					description: 'Would you like to lockdown all channels?',
					type: 'BOOLEAN',
					required: false
				}
			],
			channel: 'guild',
			clientPermissions: ['SEND_MESSAGES'],
			userPermissions: ['SEND_MESSAGES']
		});
	}
	public async exec(message: BushMessage | BushSlashMessage, { all }: { all: boolean }): Promise<unknown> {
		return await message.util.reply('no');
		if (!all) {
			if (!['GUILD_TEXT', 'GUILD_NEWS'].includes(message.channel.type))
				return message.util.reply(`${util.emojis.error} You can only lock down text and announcement channels.`);

			// eslint-disable-next-line @typescript-eslint/no-unused-vars
			const lockdownSuccess = await util.lockdownChannel({
				channel: message.channel as BushTextChannel | BushNewsChannel,
				moderator: message.author
			});
		}
	}
}