From 08d7e6eb125c5ff6846c3a92491de79d291b8e12 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Wed, 29 Dec 2021 16:15:06 -0500 Subject: misc improvements & typings changes --- src/commands/admin/channelPermissions.ts | 2 +- src/commands/admin/roleAll.ts | 4 +- src/commands/config/_customAutomodPhrases.ts | 41 ++++++++++++++ src/commands/config/_levelRoles.ts | 41 ++++++++++++++ src/commands/config/blacklist.ts | 13 +++-- src/commands/config/customAutomodPhrases.ts | 59 -------------------- src/commands/config/levelRoles.ts | 59 -------------------- src/commands/dev/__template.ts | 4 +- src/commands/dev/dm.ts | 17 +++--- src/commands/dev/say.ts | 2 +- src/commands/dev/superUser.ts | 7 +-- src/commands/moderation/_activePunishments.ts | 76 ++++++++++++++++++++++++++ src/commands/moderation/activePunishments.ts | 76 -------------------------- src/commands/moderation/removeReactionEmoji.ts | 6 +- src/commands/moderation/unmute.ts | 8 +-- src/commands/moderation/warn.ts | 8 +-- src/commands/utilities/remind.ts | 2 +- src/commands/utilities/reminders.ts | 2 +- src/commands/utilities/steal.ts | 4 +- src/commands/utilities/suicide.ts | 2 +- src/commands/utilities/uuid.ts | 4 +- 21 files changed, 201 insertions(+), 236 deletions(-) create mode 100644 src/commands/config/_customAutomodPhrases.ts create mode 100644 src/commands/config/_levelRoles.ts delete mode 100644 src/commands/config/customAutomodPhrases.ts delete mode 100644 src/commands/config/levelRoles.ts create mode 100644 src/commands/moderation/_activePunishments.ts delete mode 100644 src/commands/moderation/activePunishments.ts (limited to 'src/commands') diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts index 8c7c540..026f1a6 100644 --- a/src/commands/admin/channelPermissions.ts +++ b/src/commands/admin/channelPermissions.ts @@ -62,7 +62,7 @@ export default class ChannelPermissionsCommand extends BushCommand { state: 'true' | 'false' | 'neutral'; } ) { - if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); + if (!message.inGuild()) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); if (!message.member!.permissions.has('ADMINISTRATOR') && !message.member!.user.isOwner()) return await message.util.reply(`${util.emojis.error} You must have admin perms to use this command.`); if (message.util.isSlashMessage(message)) await message.interaction.deferReply(); diff --git a/src/commands/admin/roleAll.ts b/src/commands/admin/roleAll.ts index 5ef379a..6e82011 100644 --- a/src/commands/admin/roleAll.ts +++ b/src/commands/admin/roleAll.ts @@ -37,8 +37,8 @@ export default class RoleAllCommand extends BushCommand { }); } - public override async exec(message: BushMessage | BushSlashMessage, args: { role: ArgType<'role'>; bots: boolean }) { - if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); + public override async exec(message: BushMessage | BushSlashMessage, args: { role: ArgType<'role'>; bots: ArgType<'boolean'> }) { + if (!message.inGuild()) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); if (!message.member!.permissions.has('ADMINISTRATOR') && !message.member!.user.isOwner()) return await message.util.reply(`${util.emojis.error} You must have admin perms to use this command.`); if (message.util.isSlashMessage(message)) await message.interaction.deferReply(); diff --git a/src/commands/config/_customAutomodPhrases.ts b/src/commands/config/_customAutomodPhrases.ts new file mode 100644 index 0000000..cd59c9a --- /dev/null +++ b/src/commands/config/_customAutomodPhrases.ts @@ -0,0 +1,41 @@ +// import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; + +// export default class CustomAutomodPhrasesCommand extends BushCommand { +// public constructor() { +// super('customAutomodPhrases', { +// aliases: ['custom-automod-phrases'], +// category: 'config', +// description: 'Configure additional phrases to be used for automod.', +// usage: ['custom-automod-phrases [optionalArg]'], +// examples: ['custom-automod-phrases 1 2'], +// args: [ +// { +// id: 'required_argument', +// type: 'string', +// description: 'This is the first argument.', +// prompt: 'What would you like to set your first argument to be?', +// retry: '{error} Pick a valid argument.', +// slashType: 'STRING' +// }, +// { +// id: 'optional_argument', +// type: 'string', +// description: 'This is the second argument.', +// prompt: 'What would you like to set your second argument to be?', +// retry: '{error} Pick a valid argument.', +// optional: true, +// slashType: 'STRING' +// } +// ], +// slash: true, +// channel: 'guild', +// clientPermissions: (m) => util.clientSendAndPermCheck(m), +// userPermissions: ['MANAGE_GUILD'] +// }); +// } + +// public override async exec( +// message: BushMessage | BushSlashMessage, +// args: { required_argument: string; optional_argument: string } +// ) {} +// } diff --git a/src/commands/config/_levelRoles.ts b/src/commands/config/_levelRoles.ts new file mode 100644 index 0000000..af7e637 --- /dev/null +++ b/src/commands/config/_levelRoles.ts @@ -0,0 +1,41 @@ +// import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; + +// export default class LevelRolesCommand extends BushCommand { +// public constructor() { +// super('levelRole', { +// aliases: ['level-role', 'level-roles', 'lr'], +// category: 'config', +// description: 'Configure roles to be assigned to users upon reaching certain levels.', +// usage: ['level-role add ', 'level-role remove '], +// examples: ['level-role 1 2'], +// args: [ +// { +// id: 'required_argument', +// type: 'string', +// description: 'This is the first argument.', +// prompt: 'What would you like to set your first argument to be?', +// retry: '{error} Pick a valid argument.', +// slashType: 'STRING' +// }, +// { +// id: 'optional_argument', +// type: 'string', +// description: 'This is the second argument.', +// prompt: 'What would you like to set your second argument to be?', +// retry: '{error} Pick a valid argument.', +// optional: true, +// slashType: 'STRING' +// } +// ], +// slash: true, +// channel: 'guild', +// clientPermissions: (m) => util.clientSendAndPermCheck(m), +// userPermissions: ['MANAGE_GUILD', 'MANAGE_ROLES'] +// }); +// } + +// public override async exec( +// message: BushMessage | BushSlashMessage, +// args: { required_argument: string; optional_argument: string } +// ) {} +// } diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts index d119774..d15b8d7 100644 --- a/src/commands/config/blacklist.ts +++ b/src/commands/config/blacklist.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, ArgType, BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; +import { AllowedMentions, BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; import { User } from 'discord.js'; export default class BlacklistCommand extends BushCommand { @@ -16,10 +16,7 @@ export default class BlacklistCommand extends BushCommand { readableType: "'blacklist'|'unblacklist'", prompt: 'Would you like to add or remove someone or something from/to the blacklist?', slashType: 'STRING', - choices: [ - { name: 'blacklist', value: 'blacklist' }, - { name: 'unblacklist', value: 'unblacklist' } - ], + choices: ['blacklist', 'unblacklist'].map((c) => ({ name: c, value: c })), only: 'slash' }, { @@ -51,7 +48,11 @@ export default class BlacklistCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, - args: { action?: 'blacklist' | 'unblacklist'; target: ArgType<'channel'> | ArgType<'user'> | string; global: boolean } + args: { + action?: 'blacklist' | 'unblacklist'; + target: ArgType<'channel'> | ArgType<'user'> | string; // there is no way to combine channel and user in slash commands without making subcommands + global: ArgType<'boolean'>; + } ) { let action: 'blacklist' | 'unblacklist' | 'toggle' = args.action ?? (message?.util?.parsed?.alias as 'blacklist' | 'unblacklist' | undefined) ?? 'toggle'; diff --git a/src/commands/config/customAutomodPhrases.ts b/src/commands/config/customAutomodPhrases.ts deleted file mode 100644 index cf37595..0000000 --- a/src/commands/config/customAutomodPhrases.ts +++ /dev/null @@ -1,59 +0,0 @@ -// import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; - -// export default class CustomAutomodPhrasesCommand extends BushCommand { -// public constructor() { -// super('customAutomodPhrases', { -// aliases: ['custom-automod-phrases'], -// category: 'config', -// description: 'Configure additional phrases to be used for automod.', -// usage: ['custom-automod-phrases [optionalArg]'], -// examples: ['custom-automod-phrases 1 2'], -// args: [ -// { -// id: 'required_argument', -// type: 'string', -// prompt: { -// start: 'What would you like to set your first argument to be?', -// retry: '{error} Pick a valid argument.', -// optional: false -// } -// }, -// { -// id: 'optional_argument', -// type: 'string', -// prompt: { -// start: 'What would you like to set your second argument to be?', -// retry: '{error} Pick a valid argument.', -// optional: true -// } -// } -// ], -// slash: true, -// slashOptions: [ -// { -// name: 'required_argument', -// description: 'What would you like to set your first argument to be?', -// type: 'STRING', -// required: true -// }, -// { -// name: 'optional_argument', -// description: 'What would you like to set your second argument to be?', -// type: 'STRING', -// required: false -// } -// ], -// channel: 'guild', -// clientPermissions: (m) => util.clientSendAndPermCheck(m), -// userPermissions: ['MANAGE_GUILD'] -// }); -// } - -// public override async exec( -// message: BushMessage | BushSlashMessage, -// args: { required_argument: string; optional_argument: string } -// ) { -// return await message.util.reply(`${util.emojis.error} Do not use the template command.`); -// args; -// } -// } diff --git a/src/commands/config/levelRoles.ts b/src/commands/config/levelRoles.ts deleted file mode 100644 index 7f99580..0000000 --- a/src/commands/config/levelRoles.ts +++ /dev/null @@ -1,59 +0,0 @@ -// import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; - -// export default class LevelRolesCommand extends BushCommand { -// public constructor() { -// super('levelRole', { -// aliases: ['level-role', 'level-roles', 'lr'], -// category: 'config', -// description: 'Configure roles to be assigned to users upon reaching certain levels.', -// usage: ['level-role add ', 'level-role remove '], -// examples: ['level-role 1 2'], -// args: [ -// { -// id: 'action', -// customType: ['add', 'remove'] -// }, -// { -// id: 'role', -// type: 'role', -// prompt: 'What would you like to set your first argument to be?', -// retry: '{error} Pick a valid argument.', -// optional: false -// }, -// { -// id: 'level', -// type: 'integer', -// prompt: 'What would you like to set your second argument to be?', -// retry: '{error} Pick a valid argument.', -// optional: false -// } -// ], -// slash: true, -// slashOptions: [ -// { -// name: 'role', -// description: 'What would you like to set your first argument to be?', -// type: 'STRING', -// required: true -// }, -// { -// name: 'level', -// description: 'What would you like to set your second argument to be?', -// type: 'STRING', -// required: true -// } -// ], -// channel: 'guild', -// clientPermissions: (m) => util.clientSendAndPermCheck(m), -// userPermissions: ['MANAGE_GUILD', 'MANAGE_ROLES'] -// }); -// } - -// public override async exec( -// message: BushMessage | BushSlashMessage, -// args: { required_argument: string; optional_argument: string } -// ) { -// return await message.util.reply(`${util.emojis.error} Do not use the template command.`); -// args; -// } -// } diff --git a/src/commands/dev/__template.ts b/src/commands/dev/__template.ts index 4341198..11d9649 100644 --- a/src/commands/dev/__template.ts +++ b/src/commands/dev/__template.ts @@ -1,4 +1,4 @@ -import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; +import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptionalArgType } from '#lib'; export default class TemplateCommand extends BushCommand { public constructor() { @@ -39,7 +39,7 @@ export default class TemplateCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, - args: { required_argument: string; optional_argument: string } + args: { required_argument: ArgType<'string'>; optional_argument: OptionalArgType<'string'> } ) { return await message.util.reply(`${util.emojis.error} Do not use the template command.`); args; diff --git a/src/commands/dev/dm.ts b/src/commands/dev/dm.ts index 4133b96..d702875 100644 --- a/src/commands/dev/dm.ts +++ b/src/commands/dev/dm.ts @@ -1,4 +1,4 @@ -import { ArgType, BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; +import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; export default class DMCommand extends BushCommand { public constructor() { @@ -21,10 +21,9 @@ export default class DMCommand extends BushCommand { id: 'content', type: 'string', match: 'rest', - description: 'This is the second argument.', - prompt: 'What would you like to set your second argument to be?', - retry: '{error} Pick a valid argument.', - optional: true, + description: 'The content to send to the user.', + prompt: 'What would you like to send to the user?', + retry: '{error} Pick something to send the user.', slashType: 'STRING' } ], @@ -35,10 +34,12 @@ export default class DMCommand extends BushCommand { userPermissions: [] }); } - public override async exec(message: BushMessage | BushSlashMessage, args: { user: ArgType<'user'>; content: string }) { + public override async exec( + message: BushMessage | BushSlashMessage, + args: { user: ArgType<'user'>; content: ArgType<'string'> } + ) { try { - const u = await client.users.fetch(args.user.id); - await u.send(args.content); + await client.users.send(args.user.id, args.content); } catch (e) { return message.util.reply(`${util.emojis.error} There was an error sending ${util.format.input(args.user.tag)} a dm.`); } diff --git a/src/commands/dev/say.ts b/src/commands/dev/say.ts index 80cbbe2..2c8151f 100644 --- a/src/commands/dev/say.ts +++ b/src/commands/dev/say.ts @@ -26,7 +26,7 @@ export default class SayCommand extends BushCommand { }); } - public override async exec(message: BushMessage, args: { content: string }) { + public override async exec(message: BushMessage | BushSlashMessage, args: { content: string }) { if (!message.author.isOwner()) return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`); diff --git a/src/commands/dev/superUser.ts b/src/commands/dev/superUser.ts index 35e98aa..3a6406d 100644 --- a/src/commands/dev/superUser.ts +++ b/src/commands/dev/superUser.ts @@ -1,4 +1,4 @@ -import { ArgType, BushCommand, Global, type BushMessage, type BushSlashMessage } from '#lib'; +import { BushCommand, Global, type ArgType, type BushMessage } from '#lib'; import { type ArgumentOptions, type Flag } from 'discord-akairo'; export default class SuperUserCommand extends BushCommand { @@ -53,10 +53,7 @@ export default class SuperUserCommand extends BushCommand { return { action, user }; } - public override async exec( - message: BushMessage | BushSlashMessage, - { action, user }: { action: 'add' | 'remove'; user: ArgType<'user'> } - ) { + public override async exec(message: BushMessage, { action, user }: { action: 'add' | 'remove'; user: ArgType<'user'> }) { if (!message.author.isOwner()) return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`); diff --git a/src/commands/moderation/_activePunishments.ts b/src/commands/moderation/_activePunishments.ts new file mode 100644 index 0000000..d40f2ba --- /dev/null +++ b/src/commands/moderation/_activePunishments.ts @@ -0,0 +1,76 @@ +// import { BushCommand, ModLog, ModLogModel, type BushGuildMember, type BushMessage, type BushSlashMessage } from '#lib'; +// import { FindOptions, Op } from 'sequelize'; + +// const punishmentTypes = ['ban', 'kick', 'mute', 'warn', 'role'] as const; + +// export default class ActivePunishmentsCommand extends BushCommand { +// public constructor() { +// super('active-punishments', { +// aliases: ['active-punishments', 'ap'], +// category: 'moderation', +// description: 'Gets a list of all the active punishment in the server.', +// usage: [`active-punishments [--moderator ] [--type <${punishmentTypes.map((v) => `'${v}'`).join('|')}>]`], +// examples: ['active-punishments'], +// args: [ +// { +// id: 'moderator', +// description: 'Only show active punishments by this moderator.', +// type: 'user', +// match: 'option', +// prompt: 'Only show active punishments from what user?', +// optional: true, +// slashType: 'USER', +// slashResolve: 'member' +// }, +// { +// id: 'type', +// description: 'Only show active punishments of this type.', +// customType: [...punishmentTypes], +// readableType: punishmentTypes.map((v) => `'${v}'`).join('|'), +// match: 'option', +// optional: true, +// slashType: 'STRING', +// choices: punishmentTypes.map((v) => ({ name: v, value: v })) +// } +// ], +// slash: true, +// channel: 'guild', +// hidden: true, +// clientPermissions: (m) => util.clientSendAndPermCheck(m), +// userPermissions: (m) => util.userGuildPermCheck(m, ['MANAGE_MESSAGES']) +// }); +// } +// public override async exec( +// message: BushMessage | BushSlashMessage, +// args: { moderator?: BushGuildMember; type: typeof punishmentTypes[number] } +// ) { +// const where: FindOptions['where'] = { guild: message.guild!.id }; +// if (args.moderator?.id) where.user = args.moderator.id; +// if (args.type) { +// switch (args.type) { +// case 'ban': +// where.type = { [Op.or]: ['PERM_BAN', 'TEMP_BAN', 'UNBAN'] }; +// break; +// case 'kick': +// where.type = { [Op.or]: ['KICK'] }; +// break; +// case 'mute': +// where.type = { [Op.or]: ['PERM_MUTE', 'TEMP_MUTE', 'UNMUTE'] }; +// break; +// case 'warn': +// where.type = { [Op.or]: ['WARN'] }; +// break; +// case 'role': +// where.type = { [Op.or]: ['PERM_PUNISHMENT_ROLE', 'TEMP_PUNISHMENT_ROLE', 'REMOVE_PUNISHMENT_ROLE'] }; +// break; +// default: +// return message.util.reply(`${util.emojis.error} You supplied an invalid case type to filter by.`); +// } +// } + +// const logs = await ModLog.findAll({ +// where, +// order: [['createdAt', 'ASC']] +// }); +// } +// } diff --git a/src/commands/moderation/activePunishments.ts b/src/commands/moderation/activePunishments.ts deleted file mode 100644 index d40f2ba..0000000 --- a/src/commands/moderation/activePunishments.ts +++ /dev/null @@ -1,76 +0,0 @@ -// import { BushCommand, ModLog, ModLogModel, type BushGuildMember, type BushMessage, type BushSlashMessage } from '#lib'; -// import { FindOptions, Op } from 'sequelize'; - -// const punishmentTypes = ['ban', 'kick', 'mute', 'warn', 'role'] as const; - -// export default class ActivePunishmentsCommand extends BushCommand { -// public constructor() { -// super('active-punishments', { -// aliases: ['active-punishments', 'ap'], -// category: 'moderation', -// description: 'Gets a list of all the active punishment in the server.', -// usage: [`active-punishments [--moderator ] [--type <${punishmentTypes.map((v) => `'${v}'`).join('|')}>]`], -// examples: ['active-punishments'], -// args: [ -// { -// id: 'moderator', -// description: 'Only show active punishments by this moderator.', -// type: 'user', -// match: 'option', -// prompt: 'Only show active punishments from what user?', -// optional: true, -// slashType: 'USER', -// slashResolve: 'member' -// }, -// { -// id: 'type', -// description: 'Only show active punishments of this type.', -// customType: [...punishmentTypes], -// readableType: punishmentTypes.map((v) => `'${v}'`).join('|'), -// match: 'option', -// optional: true, -// slashType: 'STRING', -// choices: punishmentTypes.map((v) => ({ name: v, value: v })) -// } -// ], -// slash: true, -// channel: 'guild', -// hidden: true, -// clientPermissions: (m) => util.clientSendAndPermCheck(m), -// userPermissions: (m) => util.userGuildPermCheck(m, ['MANAGE_MESSAGES']) -// }); -// } -// public override async exec( -// message: BushMessage | BushSlashMessage, -// args: { moderator?: BushGuildMember; type: typeof punishmentTypes[number] } -// ) { -// const where: FindOptions['where'] = { guild: message.guild!.id }; -// if (args.moderator?.id) where.user = args.moderator.id; -// if (args.type) { -// switch (args.type) { -// case 'ban': -// where.type = { [Op.or]: ['PERM_BAN', 'TEMP_BAN', 'UNBAN'] }; -// break; -// case 'kick': -// where.type = { [Op.or]: ['KICK'] }; -// break; -// case 'mute': -// where.type = { [Op.or]: ['PERM_MUTE', 'TEMP_MUTE', 'UNMUTE'] }; -// break; -// case 'warn': -// where.type = { [Op.or]: ['WARN'] }; -// break; -// case 'role': -// where.type = { [Op.or]: ['PERM_PUNISHMENT_ROLE', 'TEMP_PUNISHMENT_ROLE', 'REMOVE_PUNISHMENT_ROLE'] }; -// break; -// default: -// return message.util.reply(`${util.emojis.error} You supplied an invalid case type to filter by.`); -// } -// } - -// const logs = await ModLog.findAll({ -// where, -// order: [['createdAt', 'ASC']] -// }); -// } -// } diff --git a/src/commands/moderation/removeReactionEmoji.ts b/src/commands/moderation/removeReactionEmoji.ts index bede2cf..919ee40 100644 --- a/src/commands/moderation/removeReactionEmoji.ts +++ b/src/commands/moderation/removeReactionEmoji.ts @@ -1,4 +1,5 @@ -import { ArgType, BushCommand, type BushMessage } from '#lib'; +import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; +import assert from 'assert'; import { Message, type Emoji } from 'discord.js'; export default class RemoveReactionEmojiCommand extends BushCommand { @@ -37,9 +38,10 @@ export default class RemoveReactionEmojiCommand extends BushCommand { } public override async exec( - message: BushMessage, + message: BushMessage | BushSlashMessage, args: { message: ArgType<'guildMessage'> | string; emoji: ArgType<'emoji'> | ArgType<'snowflake'> } ) { + assert(message.channel); const resolvedMessage = args.message instanceof Message ? args.message : await message.channel.messages.fetch(args.message); const id = !(['string'] as const).includes(typeof args.emoji); diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts index d36a5db..e7a19d6 100644 --- a/src/commands/moderation/unmute.ts +++ b/src/commands/moderation/unmute.ts @@ -1,12 +1,12 @@ import { AllowedMentions, - ArgType, BushCommand, Moderation, - OptionalArgType, + type ArgType, type BushGuildMember, type BushMessage, - type BushSlashMessage + type BushSlashMessage, + type OptionalArgType } from '#lib'; export default class UnmuteCommand extends BushCommand { @@ -56,7 +56,7 @@ export default class UnmuteCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, - { user, reason, force }: { user: ArgType<'user'>; reason: OptionalArgType<'string'>; force: boolean } + { user, reason, force = false }: { user: ArgType<'user'>; reason: OptionalArgType<'string'>; force?: boolean } ) { const error = util.emojis.error; const member = message.guild!.members.cache.get(user.id) as BushGuildMember; diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts index 95e409d..5093c9b 100644 --- a/src/commands/moderation/warn.ts +++ b/src/commands/moderation/warn.ts @@ -1,12 +1,12 @@ import { AllowedMentions, - ArgType, BushCommand, Moderation, - OptionalArgType, + type ArgType, type BushGuildMember, type BushMessage, - type BushSlashMessage + type BushSlashMessage, + type OptionalArgType } from '#lib'; export default class WarnCommand extends BushCommand { @@ -55,7 +55,7 @@ export default class WarnCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, - { user, reason, force }: { user: ArgType<'user'>; reason: OptionalArgType<'string'>; force?: boolean } + { user, reason, force = false }: { user: ArgType<'user'>; reason: OptionalArgType<'string'>; force?: boolean } ) { const member = message.guild!.members.cache.get(user.id) as BushGuildMember; if (!member) return message.util.reply(`${util.emojis.error} I cannot warn users that are not in the server.`); diff --git a/src/commands/utilities/remind.ts b/src/commands/utilities/remind.ts index 8df24c1..6339343 100644 --- a/src/commands/utilities/remind.ts +++ b/src/commands/utilities/remind.ts @@ -1,4 +1,4 @@ -import { ArgType, BushCommand, Reminder, type BushMessage, type BushSlashMessage } from '#lib'; +import { BushCommand, Reminder, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; export default class RemindCommand extends BushCommand { public constructor() { diff --git a/src/commands/utilities/reminders.ts b/src/commands/utilities/reminders.ts index 7180aa9..34034d8 100644 --- a/src/commands/utilities/reminders.ts +++ b/src/commands/utilities/reminders.ts @@ -1,5 +1,5 @@ import { BushCommand, ButtonPaginator, Reminder, type BushMessage, type BushSlashMessage } from '#lib'; -import { MessageEmbedOptions } from 'discord.js'; +import { type MessageEmbedOptions } from 'discord.js'; import { Op } from 'sequelize'; export default class RemindersCommand extends BushCommand { diff --git a/src/commands/utilities/steal.ts b/src/commands/utilities/steal.ts index 480201a..67b8382 100644 --- a/src/commands/utilities/steal.ts +++ b/src/commands/utilities/steal.ts @@ -1,5 +1,5 @@ -import { ArgType, BushCommand, BushSlashMessage, type BushMessage } from '#lib'; -import { ArgumentOptions, ArgumentType, ArgumentTypeCaster, Flag } from 'discord-akairo'; +import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; +import { type ArgumentOptions, type ArgumentType, type ArgumentTypeCaster, type Flag } from 'discord-akairo'; import _ from 'lodash'; import { URL } from 'url'; diff --git a/src/commands/utilities/suicide.ts b/src/commands/utilities/suicide.ts index 641f7ec..f0d75a2 100644 --- a/src/commands/utilities/suicide.ts +++ b/src/commands/utilities/suicide.ts @@ -1,5 +1,5 @@ import { AllowedMentions, BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; -import { Message, MessageEmbed } from 'discord.js'; +import { MessageEmbed, type Message } from 'discord.js'; export default class TemplateCommand extends BushCommand { public constructor() { diff --git a/src/commands/utilities/uuid.ts b/src/commands/utilities/uuid.ts index 6195edd..d842b58 100644 --- a/src/commands/utilities/uuid.ts +++ b/src/commands/utilities/uuid.ts @@ -1,4 +1,4 @@ -import { BushCommand, type BushMessage } from '#lib'; +import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; export default class UuidCommand extends BushCommand { public constructor() { @@ -35,7 +35,7 @@ export default class UuidCommand extends BushCommand { } public override async exec( - message: BushMessage, + message: BushMessage | BushSlashMessage, { ign, dashed }: { ign: { match: RegExpMatchArray; matches: any[] }; dashed: boolean } ) { if (!ign) return await message.util.reply(`${util.emojis.error} Please enter a valid ign.`); -- cgit