diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-23 18:13:05 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-23 18:13:05 -0500 |
commit | a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a (patch) | |
tree | 9b0f8ed8a93c22c90512751e3f2f5937e1925760 /src/commands/moderation/lockdown.ts | |
parent | 5557677f1570eb564a30cfcebb6030235dc84d47 (diff) | |
download | tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.gz tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.bz2 tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.zip |
fix discord.js breaking changes, some other stuff
Diffstat (limited to 'src/commands/moderation/lockdown.ts')
-rw-r--r-- | src/commands/moderation/lockdown.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/commands/moderation/lockdown.ts b/src/commands/moderation/lockdown.ts index 87a2f05..350ce26 100644 --- a/src/commands/moderation/lockdown.ts +++ b/src/commands/moderation/lockdown.ts @@ -11,7 +11,7 @@ import { type OptionalArgType } from '#lib'; import assert from 'assert'; -import { Collection } from 'discord.js'; +import { ApplicationCommandOptionType, Collection, Permissions } from 'discord.js'; export default class LockdownCommand extends BushCommand { public constructor() { @@ -27,8 +27,8 @@ export default class LockdownCommand extends BushCommand { description: 'Specify a different channel to lockdown instead of the one you trigger the command in.', type: util.arg.union('textChannel', 'newsChannel', 'threadChannel'), prompt: 'What channel would you like to lockdown?', - slashType: 'CHANNEL', - channelTypes: ['GUILD_TEXT', 'GUILD_NEWS', 'GUILD_NEWS_THREAD', 'GUILD_PUBLIC_THREAD', 'GUILD_PRIVATE_THREAD'], + slashType: ApplicationCommandOptionType.Channel, + channelTypes: ['GuildText', 'GuildNews', 'GuildNewsThread', 'GuildPublicThread', 'GuildPrivateThread'], optional: true }, { @@ -37,7 +37,7 @@ export default class LockdownCommand extends BushCommand { type: 'string', match: 'rest', prompt: 'What is the reason for the lockdown?', - slashType: 'STRING', + slashType: ApplicationCommandOptionType.String, optional: true }, { @@ -46,14 +46,14 @@ export default class LockdownCommand extends BushCommand { match: 'flag', flag: '--all', prompt: 'Would you like to lockdown all configured channels?', - slashType: 'BOOLEAN', + slashType: ApplicationCommandOptionType.Boolean, optional: true } ], slash: true, channel: 'guild', - clientPermissions: (m) => util.clientSendAndPermCheck(m, ['MANAGE_CHANNELS']), - userPermissions: ['MANAGE_CHANNELS'] + clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.MANAGE_CHANNELS]), + userPermissions: [Permissions.FLAGS.MANAGE_CHANNELS] }); } @@ -134,7 +134,7 @@ export default class LockdownCommand extends BushCommand { action === 'lockdown' ? 'locked down' : 'unlocked' } **${num}** channel${num > 0 ? 's' : ''}.`; } else { - throw new Error(`Unknown response: ${response}`); + return `${util.emojis.error} An error occurred: ${util.format.input(response)}}`; } assert(messageResponse); |