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/pr |
