diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-02-19 18:52:41 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-02-19 18:52:41 -0500 |
commit | e78beed6c7e094ef48aad5d18da01b2bbed4536c (patch) | |
tree | 32676793af5f7bdc39d438ff284fa5b959274e96 /src/commands/config/blacklist.ts | |
parent | a3103b629250de3fb97a40a4f9ff7e7ba28f4d16 (diff) | |
download | tanzanite-e78beed6c7e094ef48aad5d18da01b2bbed4536c.tar.gz tanzanite-e78beed6c7e094ef48aad5d18da01b2bbed4536c.tar.bz2 tanzanite-e78beed6c7e094ef48aad5d18da01b2bbed4536c.zip |
fix: a ton of shit
Diffstat (limited to 'src/commands/config/blacklist.ts')
-rw-r--r-- | src/commands/config/blacklist.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts index d210472..ba2d24a 100644 --- a/src/commands/config/blacklist.ts +++ b/src/commands/config/blacklist.ts @@ -1,4 +1,5 @@ import { AllowedMentions, BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; +import assert from 'assert'; import { ApplicationCommandOptionType, PermissionFlagsBits, User } from 'discord.js'; export default class BlacklistCommand extends BushCommand { @@ -40,7 +41,6 @@ export default class BlacklistCommand extends BushCommand { } ], slash: true, - channel: 'guild', clientPermissions: (m) => util.clientSendAndPermCheck(m), userPermissions: [PermissionFlagsBits.ManageGuild] }); @@ -64,8 +64,11 @@ export default class BlacklistCommand extends BushCommand { if (!target) return await message.util.reply(`${util.emojis.error} Choose a valid channel or user.`); const targetID = target.id; - if (!message.guild && global) + if (!message.inGuild() && !global) return await message.util.reply(`${util.emojis.error} You have to be in a guild to disable commands.`); + + if (!global) assert(message.inGuild()); + const blacklistedUsers = global ? util.getGlobal('blacklistedUsers') : (await message.guild!.getSetting('blacklistedChannels')) ?? []; |