aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-02 18:08:43 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-02 18:08:43 -0400
commit0d87396461833b23aaaf733aaa6f03e4889f4224 (patch)
treecb319dcb6c18ae40429d23180fe8971240241122 /src/commands
parent815fbcd63ad68b41e9107967d95230385597ec41 (diff)
downloadtanzanite-0d87396461833b23aaaf733aaa6f03e4889f4224.tar.gz
tanzanite-0d87396461833b23aaaf733aaa6f03e4889f4224.tar.bz2
tanzanite-0d87396461833b23aaaf733aaa6f03e4889f4224.zip
fix: allow vc channels to be locked
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/moderation/lockdown.ts30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/commands/moderation/lockdown.ts b/src/commands/moderation/lockdown.ts
index f298ec9..d10a5d4 100644
--- a/src/commands/moderation/lockdown.ts
+++ b/src/commands/moderation/lockdown.ts
@@ -1,9 +1,6 @@
import {
AllowedMentions,
BushCommand,
- BushNewsChannel,
- BushTextChannel,
- BushThreadChannel,
ConfirmationPrompt,
type ArgType,
type BushMessage,
@@ -11,7 +8,16 @@ import {
type OptArgType
} from '#lib';
import assert from 'assert';
-import { ApplicationCommandOptionType, ChannelType, Collection, PermissionFlagsBits } from 'discord.js';
+import {
+ ApplicationCommandOptionType,
+ ChannelType,
+ Collection,
+ NewsChannel,
+ PermissionFlagsBits,
+ TextChannel,
+ ThreadChannel,
+ VoiceChannel
+} from 'discord.js';
export default class LockdownCommand extends BushCommand {
public constructor() {
@@ -25,7 +31,7 @@ export default class LockdownCommand extends BushCommand {
{
id: 'channel',
description: 'Specify a different channel to lockdown instead of the one you trigger the command in.',
- type: util.arg.union('textChannel', 'newsChannel', 'threadChannel'),
+ type: util.arg.union('textChannel', 'newsChannel', 'threadChannel', 'voiceChannel'),
prompt: 'What channel would you like to lockdown?',
slashType: ApplicationCommandOptionType.Channel,
channelTypes: [
@@ -33,7 +39,8 @@ export default class LockdownCommand extends BushCommand {
ChannelType.GuildNews,
ChannelType.GuildNewsThread,
ChannelType.GuildPublicThread,
- ChannelType.GuildPrivateThread
+ ChannelType.GuildPrivateThread,
+ ChannelType.GuildVoice
],
optional: true
},
@@ -78,7 +85,7 @@ export default class LockdownCommand extends BushCommand {
public static async lockdownOrUnlockdown(
message: BushMessage | BushSlashMessage,
args: {
- channel: OptArgType<'textChannel'> | OptArgType<'newsChannel'> | OptArgType<'threadChannel'>;
+ channel: OptArgType<'textChannel'> | OptArgType<'newsChannel'> | OptArgType<'threadChannel'> | OptArgType<'voiceChannel'>;
reason: OptArgType<'string'>;
all: ArgType<'boolean'>;
},
@@ -92,7 +99,14 @@ export default class LockdownCommand extends BushCommand {
const channel = args.channel ?? message.channel;
- if (!(channel instanceof BushTextChannel || channel instanceof BushNewsChannel || channel instanceof BushThreadChannel))
+ if (
+ !(
+ channel instanceof TextChannel ||
+ channel instanceof NewsChannel ||
+ channel instanceof ThreadChannel ||
+ channel instanceof VoiceChannel
+ )
+ )
return await message.util.reply(
`${util.emojis.error} You can only ${action} text channels, news channels, and thread channels.`
);