diff options
Diffstat (limited to 'src/commands')
58 files changed, 111 insertions, 65 deletions
diff --git a/src/commands/_fake-command/ironmoon.ts b/src/commands/_fake-command/ironmoon.ts index 500b384..8ca1f5b 100644 --- a/src/commands/_fake-command/ironmoon.ts +++ b/src/commands/_fake-command/ironmoon.ts @@ -8,13 +8,13 @@ export default class IronmoonCommand extends BushCommand { completelyHide: true }); } - public condition(message: BushMessage): boolean { + public override condition(message: BushMessage): boolean { return false; if (message.content.toLowerCase().includes('ironmoon')) return true; else return false; } - public async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { return await message.util.reply('Your message included the word ironmoon.'); } } diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts index 851e2ed..a13f07a 100644 --- a/src/commands/admin/channelPermissions.ts +++ b/src/commands/admin/channelPermissions.ts @@ -50,7 +50,7 @@ export default class ChannelPermissionsCommand extends BushCommand { }); } - public async exec( + public override async exec( message: BushMessage, { target, diff --git a/src/commands/config/autoPublishChannel.ts b/src/commands/config/autoPublishChannel.ts index 8fa987b..3381dc2 100644 --- a/src/commands/config/autoPublishChannel.ts +++ b/src/commands/config/autoPublishChannel.ts @@ -38,7 +38,7 @@ export default class AutoPublishChannelCommand extends BushCommand { }); } - public async exec(message: BushMessage, { channel }: { channel: Channel }): Promise<unknown> { + public override async exec(message: BushMessage, { channel }: { channel: Channel }): Promise<unknown> { const autoPublishChannels = await message.guild.getSetting('autoPublishChannels'); const newValue = util.addOrRemoveFromArray( autoPublishChannels.includes(channel.id) ? 'remove' : 'add', diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts index 150a1b7..78b0446 100644 --- a/src/commands/config/blacklist.ts +++ b/src/commands/config/blacklist.ts @@ -60,7 +60,7 @@ export default class BlacklistCommand extends BushCommand { }); } - public async exec( + public override async exec( message: BushMessage | BushSlashMessage, args: { action: 'blacklist' | 'unblacklist'; target: Channel | User | string; global: boolean } ): Promise<unknown> { diff --git a/src/commands/config/disable.ts b/src/commands/config/disable.ts index 5d2e4dd..a9318a5 100644 --- a/src/commands/config/disable.ts +++ b/src/commands/config/disable.ts @@ -59,7 +59,7 @@ export default class DisableCommand extends BushCommand { blacklistedCommands = ['eval', 'disable']; - public async exec( + public override async exec( message: BushMessage | BushSlashMessage, args: { action: 'enable' | 'disable'; command: BushCommand | string; global: boolean } ): Promise<unknown> { diff --git a/src/commands/config/muteRole.ts b/src/commands/config/muteRole.ts index b6e8a81..dee5322 100644 --- a/src/commands/config/muteRole.ts +++ b/src/commands/config/muteRole.ts @@ -37,7 +37,7 @@ export default class MuteRoleCommand extends BushCommand { }); } - async exec(message: BushMessage | BushSlashMessage, args: { role: Role }): Promise<void> { + override async exec(message: BushMessage | BushSlashMessage, args: { role: Role }): Promise<void> { await message.guild.setSetting('muteRole', args.role.id); await message.util.send({ content: `${util.emojis.success} Changed the server's mute role to <@&${args.role.id}>.`, diff --git a/src/commands/config/prefix.ts b/src/commands/config/prefix.ts index 9c1ce92..9f80633 100644 --- a/src/commands/config/prefix.ts +++ b/src/commands/config/prefix.ts @@ -36,7 +36,7 @@ export default class PrefixCommand extends BushCommand { }); } - async exec(message: BushMessage | BushSlashMessage, args: { prefix?: string }): Promise<unknown> { + override async exec(message: BushMessage | BushSlashMessage, args: { prefix?: string }): Promise<unknown> { const oldPrefix = await message.guild.getSetting('prefix'); await message.guild.setSetting('prefix', args.prefix ?? client.config.prefix); if (args.prefix) { diff --git a/src/commands/config/punishmentFooter.ts b/src/commands/config/punishmentFooter.ts index eeac6c1..d8daf77 100644 --- a/src/commands/config/punishmentFooter.ts +++ b/src/commands/config/punishmentFooter.ts @@ -38,7 +38,7 @@ export default class PunishmentFooterCommand extends BushCommand { }); } - async exec(message: BushMessage | BushSlashMessage, args: { ending: string }): Promise<unknown> { + override async exec(message: BushMessage | BushSlashMessage, args: { ending: string }): Promise<unknown> { await message.guild.setSetting('punishmentEnding', args.ending || null); if (args.ending) return await message.util.send({ diff --git a/src/commands/config/welcomeChannel.ts b/src/commands/config/welcomeChannel.ts index 3db9e74..a662802 100644 --- a/src/commands/config/welcomeChannel.ts +++ b/src/commands/config/welcomeChannel.ts @@ -36,7 +36,7 @@ export default class WelcomeChannelCommand extends BushCommand { userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'] }); } - public async exec(message: BushMessage | BushSlashMessage, args: { channel: Channel }): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage, args: { channel: Channel }): Promise<unknown> { const oldChannel = await message.guild.getSetting('welcomeChannel'); await message.guild.setSetting('welcomeChannel', args.channel.id ?? undefined); if (args.channel) { diff --git a/src/commands/dev/__template.ts b/src/commands/dev/__template.ts index 35c57db..949e04e 100644 --- a/src/commands/dev/__template.ts +++ b/src/commands/dev/__template.ts @@ -55,7 +55,7 @@ export default class TemplateCommand extends BushCommand { userPermissions: ['SEND_MESSAGES'] }); } - public async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { return await message.util.reply(`${util.emojis.error} Do not use the template command.`); } } diff --git a/src/commands/dev/_testDB.ts b/src/commands/dev/_testDB.ts new file mode 100644 index 0000000..e1fddb4 --- /dev/null +++ b/src/commands/dev/_testDB.ts @@ -0,0 +1,25 @@ +// import { BushCommand, BushSlashMessage, Global } from '@lib'; +// import { Message } from 'discord.js'; +// import { inspect } from 'util'; + +// export default class TestDurationCommand extends BushCommand { +// public constructor() { +// super('db', { +// aliases: ['db'], +// category: 'dev', +// description: { +// content: '', +// usage: '', +// examples: [''] +// }, +// slash: false, +// hidden: true, +// ownerOnly: true, +// completelyHide: true +// }); +// } + +// override async exec(message: Message | BushSlashMessage): Promise<unknown> { +// return await message.util.reply(await util.codeblock(inspect((await Global.findOne()).environment), 2000, 'js')); +// } +// } diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts index dbdfc4b..1475173 100644 --- a/src/commands/dev/eval.ts +++ b/src/commands/dev/eval.ts @@ -43,7 +43,7 @@ export default class EvalCommand extends BushCommand { }); } - public async exec( + public override async exec( message: BushMessage | BushSlashMessage, args: { sel_depth: number; diff --git a/src/commands/dev/reload.ts b/src/commands/dev/reload.ts index de12e34..4f11a81 100644 --- a/src/commands/dev/reload.ts +++ b/src/commands/dev/reload.ts @@ -31,7 +31,7 @@ export default class ReloadCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage /* { fast }: { fast: boolean } */): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage /* { fast }: { fast: boolean } */): Promise<unknown> { 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/say.ts b/src/commands/dev/say.ts index 0776f1b..f0a7cbf 100644 --- a/src/commands/dev/say.ts +++ b/src/commands/dev/say.ts @@ -26,7 +26,7 @@ export default class SayCommand extends BushCommand { }); } - public async exec(message: BushMessage, { say }: { say: string }): Promise<unknown> { + public override async exec(message: BushMessage, { say }: { say: string }): Promise<unknown> { if (!message.author.isOwner()) return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`); @@ -34,7 +34,7 @@ export default class SayCommand extends BushCommand { await message.util.send({ content: say, allowedMentions: AllowedMentions.none() }); } - public async execSlash(message: AkairoMessage, { content }: { content: string }): Promise<unknown> { + public override async execSlash(message: AkairoMessage, { content }: { content: string }): Promise<unknown> { if (!client.config.owners.includes(message.author.id)) { return await message.interaction.reply({ content: `${util.emojis.error} Only my developers can run this command.`, diff --git a/src/commands/dev/servers.ts b/src/commands/dev/servers.ts index 7b147b9..d8799f5 100644 --- a/src/commands/dev/servers.ts +++ b/src/commands/dev/servers.ts @@ -17,7 +17,7 @@ export default class ServersCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { const maxLength = 10; const guilds = [...client.guilds.cache.sort((a, b) => (a.memberCount < b.memberCount ? 1 : -1)).values()]; const chunkedGuilds: Guild[][] = []; diff --git a/src/commands/dev/setLevel.ts b/src/commands/dev/setLevel.ts index 4d08345..6603fcf 100644 --- a/src/commands/dev/setLevel.ts +++ b/src/commands/dev/setLevel.ts @@ -48,7 +48,10 @@ export default class SetLevelCommand extends BushCommand { }); } - async exec(message: BushMessage | BushSlashMessage, { user, level }: { user: User; level: number }): Promise<unknown> { + override async exec( + message: BushMessage | BushSlashMessage, + { user, level }: { user: User; level: number } + ): Promise<unknown> { 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/sh.ts b/src/commands/dev/sh.ts index b8c8379..7f048c0 100644 --- a/src/commands/dev/sh.ts +++ b/src/commands/dev/sh.ts @@ -36,7 +36,7 @@ export default class ShCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage, { command }: { command: string }): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage, { command }: { command: string }): Promise<unknown> { if (!client.config.owners.includes(message.author.id)) return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`); const input = clean(command); diff --git a/src/commands/dev/superUser.ts b/src/commands/dev/superUser.ts index eade861..22fa53f 100644 --- a/src/commands/dev/superUser.ts +++ b/src/commands/dev/superUser.ts @@ -37,7 +37,10 @@ export default class SuperUserCommand extends BushCommand { }; return { action, user }; } - public async exec(message: BushMessage | BushSlashMessage, args: { action: 'add' | 'remove'; user: User }): Promise<unknown> { + public override async exec( + message: BushMessage | BushSlashMessage, + args: { action: 'add' | 'remove'; user: User } + ): Promise<unknown> { 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/test.ts b/src/commands/dev/test.ts index 6b49dce..0029a3a 100644 --- a/src/commands/dev/test.ts +++ b/src/commands/dev/test.ts @@ -30,7 +30,7 @@ export default class TestCommand extends BushCommand { } // eslint-disable-next-line require-await - public async exec(message: BushMessage, args: { feature: string }): Promise<unknown> { + public override async exec(message: BushMessage, args: { feature: string }): Promise<unknown> { const responses = [ 'Yes master.', 'Test it your self bitch, I am hungry.', diff --git a/src/commands/fun/coinflip.ts b/src/commands/fun/coinflip.ts index 68484bb..e0892b7 100644 --- a/src/commands/fun/coinflip.ts +++ b/src/commands/fun/coinflip.ts @@ -14,7 +14,7 @@ export default class CoinFlipCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage): Promise<void> { + public override async exec(message: BushMessage | BushSlashMessage): Promise<void> { const random = Math.random(); let result: string; const fall = message.author.id === '322862723090219008' ? 0.1 : 0.001; diff --git a/src/commands/fun/dice.ts b/src/commands/fun/dice.ts index 46b159b..241f1d2 100644 --- a/src/commands/fun/dice.ts +++ b/src/commands/fun/dice.ts @@ -15,7 +15,7 @@ export default class EightBallCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { const responses = ['1', '2', '3', '4', '5', '6']; const answer = responses[Math.floor(Math.random() * responses.length)]; return await message.util.reply(`You rolled a **${answer}**.`); diff --git a/src/commands/fun/eightBall.ts b/src/commands/fun/eightBall.ts index 7b7d39c..efaaff5 100644 --- a/src/commands/fun/eightBall.ts +++ b/src/commands/fun/eightBall.ts @@ -35,7 +35,7 @@ export default class EightBallCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage): Promise<void> { + public override async exec(message: BushMessage | BushSlashMessage): Promise<void> { const responses = [ 'It is certain', 'Without a doubt', diff --git a/src/commands/fun/minesweeper.ts b/src/commands/fun/minesweeper.ts index 2b46e34..2bec1e9 100644 --- a/src/commands/fun/minesweeper.ts +++ b/src/commands/fun/minesweeper.ts @@ -91,7 +91,7 @@ export default class MinesweeperCommand extends BushCommand { }); } - public async exec( + public override async exec( message: BushMessage | BushSlashMessage, { rows, diff --git a/src/commands/info/avatar.ts b/src/commands/info/avatar.ts index eefdc02..37d2256 100644 --- a/src/commands/info/avatar.ts +++ b/src/commands/info/avatar.ts @@ -35,7 +35,7 @@ export default class AvatarCommand extends BushCommand { }); } - async exec(message: BushMessage | BushSlashMessage, { user }: { user: User }): Promise<void> { + override async exec(message: BushMessage | BushSlashMessage, { user }: { user: User }): Promise<void> { user = user ?? message.author; const embed = new MessageEmbed() diff --git a/src/commands/info/botInfo.ts b/src/commands/info/botInfo.ts index e47984b..c89c356 100644 --- a/src/commands/info/botInfo.ts +++ b/src/commands/info/botInfo.ts @@ -17,7 +17,7 @@ export default class BotInfoCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage): Promise<void> { + public override async exec(message: BushMessage | BushSlashMessage): Promise<void> { const developers = (await util.mapIDs(client.config.owners)).map((u) => u?.tag).join('\n'); const currentCommit = (await util.shell('git rev-parse HEAD')).stdout.replace('\n', ''); let repoUrl = (await util.shell('git remote get-url origin')).stdout.replace('\n', ''); diff --git a/src/commands/info/color.ts b/src/commands/info/color.ts index e995d79..7ceb37f 100644 --- a/src/commands/info/color.ts +++ b/src/commands/info/color.ts @@ -40,7 +40,7 @@ export default class ColorCommand extends BushCommand { return color.substr(4, color.length - 5); } - public async exec( + public override async exec( message: BushMessage | BushSlashMessage, args: { color: string | BushRole | BushGuildMember } ): Promise<unknown> { diff --git a/src/commands/info/guildInfo.ts b/src/commands/info/guildInfo.ts index 6ce4d76..2cdf3d5 100644 --- a/src/commands/info/guildInfo.ts +++ b/src/commands/info/guildInfo.ts @@ -36,7 +36,10 @@ export default class GuildInfoCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage, args: { guild: Guild | bigint | GuildPreview }): Promise<unknown> { + public override async exec( + message: BushMessage | BushSlashMessage, + args: { guild: Guild | bigint | GuildPreview } + ): Promise<unknown> { if (!args?.guild && !message.guild) { return await message.util.reply( `${util.emojis.error} You must either provide an server to provide info about or run this command in a server.` diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts index 458b7d0..691051c 100644 --- a/src/commands/info/help.ts +++ b/src/commands/info/help.ts @@ -43,7 +43,7 @@ export default class HelpCommand extends BushCommand { }); } - public async exec( + public override async exec( message: BushMessage | BushSlashMessage, args: { command: BushCommand | string; showHidden?: boolean } ): Promise<unknown> { diff --git a/src/commands/info/icon.ts b/src/commands/info/icon.ts index 598cd14..582494c 100644 --- a/src/commands/info/icon.ts +++ b/src/commands/info/icon.ts @@ -17,7 +17,7 @@ export default class IconCommand extends BushCommand { }); } - async exec(message: BushMessage | BushSlashMessage): Promise<void> { + override async exec(message: BushMessage | BushSlashMessage): Promise<void> { const embed = new MessageEmbed() .setTimestamp() .setColor(util.colors.default) diff --git a/src/commands/info/invite.ts b/src/commands/info/invite.ts index a2128b3..384c59e 100644 --- a/src/commands/info/invite.ts +++ b/src/commands/info/invite.ts @@ -18,7 +18,7 @@ export default class InviteCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { if (client.config.isDevelopment) return await message.util.reply(`${util.emojis.error} The dev bot cannot be invited.`); const ButtonRow = new MessageActionRow().addComponents( new MessageButton({ diff --git a/src/commands/info/ping.ts b/src/commands/info/ping.ts index 550c3c7..5f2220c 100644 --- a/src/commands/info/ping.ts +++ b/src/commands/info/ping.ts @@ -17,7 +17,7 @@ export default class PingCommand extends BushCommand { }); } - public async exec(message: BushMessage): Promise<void> { + public override async exec(message: BushMessage): Promise<void> { const sentMessage = (await message.util.send('Pong!')) as Message; const timestamp: number = message.editedTimestamp ? message.editedTimestamp : message.createdTimestamp; const botLatency = `${'```'}\n ${Math.round(sentMessage.createdTimestamp - timestamp)}ms ${'```'}`; @@ -35,7 +35,7 @@ export default class PingCommand extends BushCommand { }); } - public async execSlash(message: BushSlashMessage): Promise<void> { + public override async execSlash(message: BushSlashMessage): Promise<void> { const timestamp1 = message.interaction.createdTimestamp; await message.interaction.reply('Pong!'); const timestamp2 = await message.interaction.fetchReply().then((m) => (m as Message).createdTimestamp); diff --git a/src/commands/info/pronouns.ts b/src/commands/info/pronouns.ts index 82ee04f..6f2b074 100644 --- a/src/commands/info/pronouns.ts +++ b/src/commands/info/pronouns.ts @@ -60,7 +60,7 @@ export default class PronounsCommand extends BushCommand { slash: true }); } - async exec(message: Message | BushSlashMessage, args: { user?: User }): Promise<unknown> { + override async exec(message: Message | BushSlashMessage, args: { user?: User }): Promise<unknown> { const user = args.user || message.author; const author = user.id === message.author.id; try { diff --git a/src/commands/info/snowflakeInfo.ts b/src/commands/info/snowflakeInfo.ts index b6b9e16..f293219 100644 --- a/src/commands/info/snowflakeInfo.ts +++ b/src/commands/info/snowflakeInfo.ts @@ -52,7 +52,7 @@ export default class SnowflakeInfoCommand extends BushCommand { ] }); } - public async exec(message: BushMessage | BushSlashMessage, args: { snowflake: bigint }): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage, args: { snowflake: bigint }): Promise<unknown> { const snowflake = `${args.snowflake}` as Snowflake; const snowflakeEmbed = new MessageEmbed().setTitle('Unknown :snowflake:').setColor(util.colors.default); diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts index cecf5ec..d9922d0 100644 --- a/src/commands/info/userInfo.ts +++ b/src/commands/info/userInfo.ts @@ -40,7 +40,7 @@ export default class UserInfoCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage, args: { user: GuildMember }): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage, args: { user: GuildMember }): Promise<unknown> { const user = args?.user || message.member; const emojis = []; const superUsers = client.cache.global.superUsers; diff --git a/src/commands/moderation/_lockdown.ts b/src/commands/moderation/_lockdown.ts index df5a9b4..374e8f1 100644 --- a/src/commands/moderation/_lockdown.ts +++ b/src/commands/moderation/_lockdown.ts @@ -31,7 +31,7 @@ export default class LockdownCommand extends BushCommand { userPermissions: ['SEND_MESSAGES'] }); } - public async exec(message: BushMessage | BushSlashMessage, { all }: { all: boolean }): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage, { all }: { all: boolean }): Promise<unknown> { return await message.util.reply('no'); if (!all) { if (!['GUILD_TEXT', 'GUILD_NEWS'].includes(message.channel.type)) diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index 9239f2a..cfa3e31 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -80,7 +80,7 @@ export default class BanCommand extends BushCommand { userPermissions: ['BAN_MEMBERS'] }); } - async exec( + override async exec( message: BushMessage | BushSlashMessage, { user, diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index 5fd83b7..c425124 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -55,7 +55,7 @@ export default class KickCommand extends BushCommand { }); } - async exec( + override async exec( message: BushMessage | BushSlashMessage, { user, reason, force }: { user: BushUser; reason?: string; force: boolean } ): Promise<unknown> { diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts index 4850a4d..8f727a5 100644 --- a/src/commands/moderation/modlog.ts +++ b/src/commands/moderation/modlog.ts @@ -46,7 +46,7 @@ export default class ModlogCommand extends BushCommand { return modLog.join(`\n`); } - async exec(message: BushMessage | BushSlashMessage, { search }: { search: BushUser | string }): Promise<unknown> { + override async exec(message: BushMessage | BushSlashMessage, { search }: { search: BushUser | string }): Promise<unknown> { const foundUser = search instanceof User ? search : await util.resolveUserAsync(search); if (foundUser) { const logs = await ModLog.findAll({ diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts index 7f3edbb..df8e235 100644 --- a/src/commands/moderation/mute.ts +++ b/src/commands/moderation/mute.ts @@ -56,7 +56,7 @@ export default class MuteCommand extends BushCommand { userPermissions: ['MANAGE_MESSAGES'] }); } - async exec( + public override async exec( message: BushMessage | BushSlashMessage, { user, reason, force }: { user: BushUser; reason?: { duration: number; contentWithoutTime: string }; force: boolean } ): Promise<unknown> { diff --git a/src/commands/moderation/removeReactionEmoji.ts b/src/commands/moderation/removeReactionEmoji.ts index de5e8ce..075b822 100644 --- a/src/commands/moderation/removeReactionEmoji.ts +++ b/src/commands/moderation/removeReactionEmoji.ts @@ -36,7 +36,7 @@ export default class RemoveReactionEmojiCommand extends BushCommand { }); } - public async exec( + public override async exec( message: BushMessage, { messageToRemoveFrom, emoji }: { messageToRemoveFrom: BushMessage; emoji: Emoji | BigInt } ): Promise<unknown> { diff --git a/src/commands/moderation/role.ts b/src/commands/moderation/role.ts index bd8cf8d..1371ee8 100644 --- a/src/commands/moderation/role.ts +++ b/src/commands/moderation/role.ts @@ -90,7 +90,7 @@ export default class RoleCommand extends BushCommand { }); } - public async exec( + public override async exec( message: BushMessage | BushSlashMessage, { action, user, role, duration }: { action: 'add' | 'remove'; user: BushGuildMember; role: BushRole; duration: number } ): Promise<unknown> { diff --git a/src/commands/moderation/slowmode.ts b/src/commands/moderation/slowmode.ts index 441a0ac..fd3aec6 100644 --- a/src/commands/moderation/slowmode.ts +++ b/src/commands/moderation/slowmode.ts @@ -48,7 +48,7 @@ export default class SlowModeCommand extends BushCommand { }); } - public async exec( + public override async exec( message: BushMessage | BushSlashMessage, { length, diff --git a/src/commands/moderation/unban.ts b/src/commands/moderation/unban.ts index 8aa9ef0..522c715 100644 --- a/src/commands/moderation/unban.ts +++ b/src/commands/moderation/unban.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, BushUser } from '@lib'; import { User } from 'discord.js'; export default class UnbanCommand extends BushCommand { @@ -51,9 +51,12 @@ export default class UnbanCommand extends BushCommand { userPermissions: ['BAN_MEMBERS'] }); } - async exec(message: BushMessage | BushSlashMessage, { user, reason }: { user: User; reason?: string }): Promise<unknown> { + override async exec( + message: BushMessage | BushSlashMessage, + { user, reason }: { user: BushUser; reason?: string } + ): Promise<unknown> { if (!(user instanceof User)) { - user = util.resolveUser(user, client.users.cache); + user = util.resolveUser(user, client.users.cache) as BushUser; } const responseCode = await message.guild.unban({ user, diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts index 528317c..6cdb08b 100644 --- a/src/commands/moderation/unmute.ts +++ b/src/commands/moderation/unmute.ts @@ -50,7 +50,10 @@ export default class UnmuteCommand extends BushCommand { userPermissions: ['MANAGE_MESSAGES'] }); } - async exec(message: BushMessage | BushSlashMessage, { user, reason }: { user: BushUser; reason?: string }): Promise<unknown> { + override async exec( + message: BushMessage | BushSlashMessage, + { user, reason }: { user: BushUser; reason?: string } + ): Promise<unknown> { const error = util.emojis.error; const member = message.guild.members.cache.get(user.id) as BushGuildMember; const canModerateResponse = util.moderationPermissionCheck(message.member, member, 'unmute'); diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts index 3f9e9b5..1067033 100644 --- a/src/commands/moderation/warn.ts +++ b/src/commands/moderation/warn.ts @@ -54,7 +54,7 @@ export default class WarnCommand extends BushCommand { userPermissions: ['MANAGE_MESSAGES'] }); } - public async exec( + public override async exec( message: BushMessage | BushSlashMessage, { user, reason, force }: { user: BushUser; reason: string; force: boolean } ): Promise<unknown> { diff --git a/src/commands/moulberry-bush/capePerms.ts b/src/commands/moulberry-bush/capePerms.ts index 7a021ed..eb1ab89 100644 --- a/src/commands/moulberry-bush/capePerms.ts +++ b/src/commands/moulberry-bush/capePerms.ts @@ -37,7 +37,7 @@ export default class CapePermissionsCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage, args: { ign: string }): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage, args: { ign: string }): Promise<unknown> { interface Capeperms { success: boolean; perms: User[]; diff --git a/src/commands/moulberry-bush/giveawayPing.ts b/src/commands/moulberry-bush/giveawayPing.ts index 269c33f..4abc6ab 100644 --- a/src/commands/moulberry-bush/giveawayPing.ts +++ b/src/commands/moulberry-bush/giveawayPing.ts @@ -23,7 +23,7 @@ export default class GiveawayPingCommand extends BushCommand { }); } - public async exec(message: BushMessage): Promise<unknown> { + public override async exec(message: BushMessage): Promise<unknown> { if (!message.member.permissions.has('MANAGE_GUILD')) await message.util.reply(`${util.emojis.error} You are missing the \`manage server\` permission.`); diff --git a/src/commands/moulberry-bush/level.ts b/src/commands/moulberry-bush/level.ts index 86ab985..fef4538 100644 --- a/src/commands/moulberry-bush/level.ts +++ b/src/commands/moulberry-bush/level.ts @@ -136,7 +136,7 @@ export default class LevelCommand extends BushCommand { } } - async exec(message: BushMessage | BushSlashMessage, { user }: { user?: BushUser }): Promise<void> { + override async exec(message: BushMessage | BushSlashMessage, { user }: { user?: BushUser }): Promise<void> { // await message.reply( // new MessageAttachment( // await this.getImage(user || message.author), diff --git a/src/commands/moulberry-bush/report.ts b/src/commands/moulberry-bush/report.ts index 2ee02bd..e91420b 100644 --- a/src/commands/moulberry-bush/report.ts +++ b/src/commands/moulberry-bush/report.ts @@ -1,6 +1,6 @@ -import { GuildMember, MessageEmbed, TextChannel } from 'discord.js'; +import { GuildMember, MessageEmbed } from 'discord.js'; import moment from 'moment'; -import { AllowedMentions, BushCommand, BushMessage } from '../../lib'; +import { AllowedMentions, BushCommand, BushMessage, BushTextChannel } from '../../lib'; export default class ReportCommand extends BushCommand { public constructor() { @@ -55,7 +55,10 @@ export default class ReportCommand extends BushCommand { }); } - public async exec(message: BushMessage, { member, evidence }: { member: GuildMember; evidence: string }): Promise<unknown> { + public override async exec( + message: BushMessage, + { member, evidence }: { member: GuildMember; evidence: string } + ): Promise<unknown> { if (message.guild.id != client.consts.mappings.guilds.bush) return await message.util.reply(`${util.emojis.error} This command can only be run in Moulberry's bush.`); if (!member) return await message.util.reply(`${util.emojis.error} Choose someone to report`); @@ -103,7 +106,7 @@ export default class ReportCommand extends BushCommand { reportEmbed.addField('Attachment', message.attachments.first().url); } } - const reportChannel = <TextChannel>client.channels.cache.get('782972723654688848'); + const reportChannel = client.channels.cache.get('782972723654688848') as unknown as BushTextChannel; await reportChannel.send({ embeds: [reportEmbed] }).then(async (ReportMessage) => { try { await ReportMessage.react(util.emojis.success); diff --git a/src/commands/moulberry-bush/rule.ts b/src/commands/moulberry-bush/rule.ts index 41dd8de..eb767a8 100644 --- a/src/commands/moulberry-bush/rule.ts +++ b/src/commands/moulberry-bush/rule.ts @@ -103,7 +103,7 @@ export default class RuleCommand extends BushCommand { }); } - public async exec(message: BushMessage, { rule, user }: { rule: undefined | number; user: User }): Promise<unknown> { + public override async exec(message: BushMessage, { rule, user }: { rule: undefined | number; user: User }): Promise<unknown> { const rulesEmbed = new MessageEmbed() .setColor('#ef3929') .setFooter(`Triggered by ${message.author.tag}`, message.author.avatarURL({ dynamic: true })) diff --git a/src/commands/skyblock-reborn/chooseColor.ts b/src/commands/skyblock-reborn/chooseColor.ts index 9b4b7c9..3814670 100644 --- a/src/commands/skyblock-reborn/chooseColor.ts +++ b/src/commands/skyblock-reborn/chooseColor.ts @@ -118,7 +118,10 @@ export default class ChooseColorCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage, args: { color: Role | RoleResolvable }): Promise<unknown> { + public override async exec( + message: BushMessage | BushSlashMessage, + args: { color: Role | RoleResolvable } + ): Promise<unknown> { if (message.guild.id != client.consts.mappings.guilds.sbr) { return await message.util.reply(`${util.emojis.error} This command can only be run in Skyblock: Reborn.`); } diff --git a/src/commands/utilities/decode.ts b/src/commands/utilities/decode.ts index cab23d8..3fb340d 100644 --- a/src/commands/utilities/decode.ts +++ b/src/commands/utilities/decode.ts @@ -88,7 +88,7 @@ export default class DecodeCommand extends BushCommand { }); } - public async exec( + public override async exec( message: BushMessage | AkairoMessage, { from, to, data }: { from: BufferEncoding; to: BufferEncoding; data: string } ): Promise<unknown> { diff --git a/src/commands/utilities/hash.ts b/src/commands/utilities/hash.ts index fcf2da3..633a263 100644 --- a/src/commands/utilities/hash.ts +++ b/src/commands/utilities/hash.ts @@ -26,7 +26,7 @@ export default class HashCommand extends BushCommand { }); } - public async exec(message: BushMessage, { url }: { url: string }): Promise<void> { + public override async exec(message: BushMessage, { url }: { url: string }): Promise<void> { try { const req = await got.get(url); const rawHash = crypto.createHash('md5'); diff --git a/src/commands/utilities/price.ts b/src/commands/utilities/price.ts index 38cd8ca..a68c01d 100644 --- a/src/commands/utilities/price.ts +++ b/src/commands/utilities/price.ts @@ -97,7 +97,7 @@ export default class PriceCommand extends BushCommand { }); } - public async exec(message: BushMessage, { item, strict }: { item: string; strict: boolean }): Promise<unknown> { + public override async exec(message: BushMessage, { item, strict }: { item: string; strict: boolean }): Promise<unknown> { const errors = new Array<string>(); const [bazaar, currentLowestBIN, averageLowestBIN, auctionAverages] = ( diff --git a/src/commands/utilities/serverStatus.ts b/src/commands/utilities/serverStatus.ts index b9d6136..02db638 100644 --- a/src/commands/utilities/serverStatus.ts +++ b/src/commands/utilities/serverStatus.ts @@ -19,7 +19,7 @@ export default class ServerStatusCommand extends BushCommand { }); } - public async exec(message: BushMessage): Promise<void> { + public override async exec(message: BushMessage): Promise<void> { const msgEmbed: MessageEmbed = new MessageEmbed() .setTitle('Server status') .setDescription(`Checking server:\n${util.emojis.loading}`) diff --git a/src/commands/utilities/uuid.ts b/src/commands/utilities/uuid.ts index 02ca506..06856d9 100644 --- a/src/commands/utilities/uuid.ts +++ b/src/commands/utilities/uuid.ts @@ -29,7 +29,7 @@ export default class UuidCommand extends BushCommand { } // eslint-disable-next-line @typescript-eslint/no-explicit-any - public async exec(message: BushMessage, { ign }: { ign: { match: any[]; matches: any[] } }): Promise<unknown> { + public override async exec(message: BushMessage, { ign }: { ign: { match: any[]; matches: any[] } }): Promise<unknown> { if (!ign) return await message.util.reply(`${util.emojis.error} Please enter a valid ign.`); const readableIGN = ign.match[0]; try { diff --git a/src/commands/utilities/viewraw.ts b/src/commands/utilities/viewraw.ts index ca21b4b..46353ba 100644 --- a/src/commands/utilities/viewraw.ts +++ b/src/commands/utilities/viewraw.ts @@ -43,7 +43,7 @@ export default class ViewRawCommand extends BushCommand { }); } - public async exec( + public override async exec( message: BushMessage | BushSlashMessage, args: { message: Message | BigInt; channel: TextChannel | NewsChannel | DMChannel; json?: boolean } ): Promise<unknown> { diff --git a/src/commands/utilities/whoHasRole.ts b/src/commands/utilities/whoHasRole.ts index 4bd81bb..a6c4665 100644 --- a/src/commands/utilities/whoHasRole.ts +++ b/src/commands/utilities/whoHasRole.ts @@ -36,7 +36,7 @@ export default class WhoHasRoleCommand extends BushCommand { userPermissions: ['SEND_MESSAGES'] }); } - public async exec(message: BushMessage | BushSlashMessage, args: { role: Role }): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage, args: { role: Role }): Promise<unknown> { const roleMembers = args.role.members.map((member) => `${member.user} (${Util.escapeMarkdown(member.user.tag)})`); const chunkedRoleMembers = util.chunk(roleMembers, 30); |