aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/unban.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/moderation/unban.ts')
-rw-r--r--src/commands/moderation/unban.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/commands/moderation/unban.ts b/src/commands/moderation/unban.ts
index 7bdb32e..a6afc0a 100644
--- a/src/commands/moderation/unban.ts
+++ b/src/commands/moderation/unban.ts
@@ -7,6 +7,7 @@ import {
type BushSlashMessage,
type OptionalArgType
} from '#lib';
+import assert from 'assert';
import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
export default class UnbanCommand extends BushCommand {
@@ -21,7 +22,7 @@ export default class UnbanCommand extends BushCommand {
{
id: 'user',
description: 'The user to unban.',
- type: 'globalUser',
+ type: util.arg.compose('user', 'globalUser'),
prompt: 'What user would you like to unban?',
retry: '{error} Choose a valid user to unban.',
slashType: ApplicationCommandOptionType.User
@@ -48,7 +49,9 @@ export default class UnbanCommand extends BushCommand {
message: BushMessage | BushSlashMessage,
{ user, reason }: { user: ArgType<'user'>; reason: OptionalArgType<'string'> }
) {
- const responseCode = await message.guild!.bushUnban({
+ assert(message.inGuild());
+
+ const responseCode = await message.guild.bushUnban({
user,
moderator: message.author,
reason