aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/unlockdown.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-12-29 17:17:39 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-12-29 17:17:39 -0500
commit602329510e11165aef42b3c6071bb1118e4d95c3 (patch)
tree3bd85f7808cc1aca2dee6ff879432d4ba5d35bf7 /src/commands/moderation/unlockdown.ts
parent825d0299e1e155ff63e040cc9f1ffc2a4f00c4a4 (diff)
downloadtanzanite-602329510e11165aef42b3c6071bb1118e4d95c3.tar.gz
tanzanite-602329510e11165aef42b3c6071bb1118e4d95c3.tar.bz2
tanzanite-602329510e11165aef42b3c6071bb1118e4d95c3.zip
lockdown and unlockdown command
Diffstat (limited to 'src/commands/moderation/unlockdown.ts')
-rw-r--r--src/commands/moderation/unlockdown.ts58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/commands/moderation/unlockdown.ts b/src/commands/moderation/unlockdown.ts
new file mode 100644
index 0000000..87b27eb
--- /dev/null
+++ b/src/commands/moderation/unlockdown.ts
@@ -0,0 +1,58 @@
+import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptionalArgType } from '#lib';
+import LockdownCommand from './lockdown.js';
+
+export default class UnlockdownCommand extends BushCommand {
+ public constructor() {
+ super('unlockdown', {
+ aliases: ['unlockdown'],
+ category: 'moderation',
+ description: 'Allows you to unlockdown a channel or all configured channels.',
+ usage: ['unlockdown [channel] [reason] [--all]'],
+ examples: ['unlockdown', 'unlockdown --all'],
+ args: [
+ {
+ id: 'channel',
+ description: 'Specify a different channel to unlockdown instead of the one you trigger the command in.',
+ type: util.arg.union('textChannel', 'newsChannel', 'threadChannel'),
+ prompt: 'What channel would you like to unlockdown?',
+ slashType: 'CHANNEL',
+ channelTypes: ['GUILD_TEXT', 'GUILD_NEWS', 'GUILD_NEWS_THREAD', 'GUILD_PUBLIC_THREAD', 'GUILD_PRIVATE_THREAD'],
+ optional: true
+ },
+ {
+ id: 'all',
+ description: 'Whether or not to unlock all configured channels.',
+ match: 'flag',
+ flag: '--all',
+ prompt: 'Would you like to unlockdown all configured channels?',
+ slashType: 'BOOLEAN',
+ optional: true
+ },
+ {
+ id: 'reason',
+ description: 'The reason for the unlock.',
+ type: 'string',
+ match: 'rest',
+ prompt: 'What is the reason for the unlock?',
+ slashType: 'STRING',
+ optional: true
+ }
+ ],
+ slash: true,
+ channel: 'guild',
+ clientPermissions: (m) => util.clientSendAndPermCheck(m, ['MANAGE_CHANNELS']),
+ userPermissions: ['MANAGE_CHANNELS']
+ });
+ }
+
+ public override async exec(
+ message: BushMessage | BushSlashMessage,
+ args: {
+ channel: OptionalArgType<'textChannel'> | OptionalArgType<'newsChannel'> | OptionalArgType<'threadChannel'>;
+ reason: OptionalArgType<'string'>;
+ all: ArgType<'boolean'>;
+ }
+ ) {
+ return await LockdownCommand.lockdownOrUnlockdown(message, args, 'unlockdown');
+ }
+}