diff options
Diffstat (limited to 'src/commands/moderation')
-rw-r--r-- | src/commands/moderation/ban.ts | 6 | ||||
-rw-r--r-- | src/commands/moderation/modlog.ts | 2 | ||||
-rw-r--r-- | src/commands/moderation/mute.ts | 2 | ||||
-rw-r--r-- | src/commands/moderation/purge.ts | 2 | ||||
-rw-r--r-- | src/commands/moderation/removeReactionEmoji.ts | 2 | ||||
-rw-r--r-- | src/commands/moderation/slowmode.ts | 4 |
6 files changed, 9 insertions, 9 deletions
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index 3d68a97..506a7c3 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -13,7 +13,7 @@ export default class BanCommand extends BushCommand { { id: 'user', description: 'The user that will be banned.', - customType: util.arg.union('user', 'snowflake'), + type: util.arg.union('user', 'snowflake'), prompt: 'What user would you like to ban?', retry: '{error} Choose a valid user to ban.', slashType: 'USER' @@ -35,7 +35,7 @@ export default class BanCommand extends BushCommand { match: 'option', prompt: "How many days of the user's messages would you like to delete?", retry: '{error} Choose between 0 and 7 days to delete messages from the user for.', - customType: util.arg.range('integer', 0, 7, true), + type: util.arg.range('integer', 0, 7, true), optional: true, slashType: 'INTEGER', choices: [...Array(8).keys()].map((v) => ({ name: v.toString(), value: v })) @@ -91,7 +91,7 @@ export default class BanCommand extends BushCommand { return message.util.reply(`${util.emojis.error} The delete days must be an integer between 0 and 7.`); } - let time: number; + let time: number | null; if (args.reason) { time = typeof args.reason === 'string' ? await util.arg.cast('duration', message, args.reason) : args.reason.duration; } diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts index 474eaa9..0f2d33c 100644 --- a/src/commands/moderation/modlog.ts +++ b/src/commands/moderation/modlog.ts @@ -13,7 +13,7 @@ export default class ModlogCommand extends BushCommand { { id: 'search', description: 'The case id or user to search for modlogs by.', - customType: util.arg.union('user', 'string'), + type: util.arg.union('user', 'string'), prompt: 'What case id or user would you like to see?', retry: '{error} Choose a valid case id or user.', slashType: 'STRING' diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts index a18c04e..c7091b3 100644 --- a/src/commands/moderation/mute.ts +++ b/src/commands/moderation/mute.ts @@ -49,7 +49,7 @@ export default class MuteCommand extends BushCommand { message: BushMessage | BushSlashMessage, args: { user: BushUser; reason?: { duration: number | null; contentWithoutTime: string } | string; force: boolean } ) { - const reason: { duration: number | null; contentWithoutTime: string } = args.reason + const reason: { duration: number | null; contentWithoutTime: string | null } = args.reason ? typeof args.reason === 'string' ? await util.arg.cast('contentWithDuration', message, args.reason) : args.reason diff --git a/src/commands/moderation/purge.ts b/src/commands/moderation/purge.ts index 21b9a3a..f039046 100644 --- a/src/commands/moderation/purge.ts +++ b/src/commands/moderation/purge.ts @@ -13,7 +13,7 @@ export default class PurgeCommand extends BushCommand { { id: 'amount', description: 'The amount of messages to purge.', - customType: util.arg.range('integer', 1, 100, true), + type: util.arg.range('integer', 1, 100, true), readableType: 'integer', prompt: 'How many messages would you like to purge?', retry: '{error} Please pick a number between 1 and 100.', diff --git a/src/commands/moderation/removeReactionEmoji.ts b/src/commands/moderation/removeReactionEmoji.ts index d543f60..4ada9d5 100644 --- a/src/commands/moderation/removeReactionEmoji.ts +++ b/src/commands/moderation/removeReactionEmoji.ts @@ -21,7 +21,7 @@ export default class RemoveReactionEmojiCommand extends BushCommand { { id: 'emoji', description: 'The emoji to remove all the reactions of from a message.', - customType: util.arg.union('emoji', 'snowflake'), + type: util.arg.union('emoji', 'snowflake'), readableType: 'emoji|snowflake', match: 'restContent', prompt: 'What emoji would you like to remove?', diff --git a/src/commands/moderation/slowmode.ts b/src/commands/moderation/slowmode.ts index 949038c..f4ab822 100644 --- a/src/commands/moderation/slowmode.ts +++ b/src/commands/moderation/slowmode.ts @@ -21,7 +21,7 @@ export default class SlowModeCommand extends BushCommand { { id: 'length', description: 'The amount of time to set the slowmode of a channel to.', - customType: Argument.union('duration', 'durationSeconds', 'off', 'none', 'disable'), + type: Argument.union('duration', 'durationSeconds', 'off', 'none', 'disable'), readableType: "duration|durationSeconds|'off'|'none'|'disable'", prompt: 'What would you like to set the slowmode to?', retry: '{error} Please set the slowmode to a valid length.', @@ -52,7 +52,7 @@ export default class SlowModeCommand extends BushCommand { length, channel }: { - length: number | 'off' | 'none' | 'disable'; + length: number | 'off' | 'none' | 'disable' | null; channel: TextChannel | ThreadChannel | BushTextChannel | BushNewsChannel | BushThreadChannel | NewsChannel; } ) { |