diff options
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/dev/eval.ts | 6 | ||||
-rw-r--r-- | src/commands/dev/reload.ts | 6 | ||||
-rw-r--r-- | src/commands/dev/setLevel.ts | 4 | ||||
-rw-r--r-- | src/commands/moderation/kick.ts | 4 | ||||
-rw-r--r-- | src/commands/moderation/mute.ts | 20 | ||||
-rw-r--r-- | src/commands/moderation/warn.ts | 4 |
6 files changed, 20 insertions, 24 deletions
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts index ebf055b..82b0e5e 100644 --- a/src/commands/dev/eval.ts +++ b/src/commands/dev/eval.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable @typescript-eslint/no-unused-vars */ import { exec } from 'child_process'; import { Constants } from 'discord-akairo'; @@ -198,7 +199,6 @@ export default class EvalCommand extends BushCommand { MessageSelectMenu, ReactionCollector, Util - // eslint-disable-next-line @typescript-eslint/no-var-requires } = require('discord.js'); // I would use import here but esbuild doesn't like that if (code[code.lang].replace(/ /g, '').includes('9+10' || '10+9')) { output = 21; @@ -259,7 +259,7 @@ export default class EvalCommand extends BushCommand { } else { embed.addField('📥 Input', await this.client.util.codeblock(inputJS, 1024, 'js')); } - embed.addField('📤 Output', await this.client.util.codeblock(typeof e === 'object' ? e?.stack : e, 1024, 'js')); + embed.addField('📤 Output', await this.client.util.codeblock(e?.stack || e, 1024, 'js')); } if (!args.silent && !message.util.isSlash) { await message.util.reply({ embeds: [embed], ephemeral: args.silent }); @@ -269,7 +269,7 @@ export default class EvalCommand extends BushCommand { try { await message.author.send({ embeds: [embed] }); if (!args.deleteMSG) await (message as BushMessage).react(this.client.util.emojis.successFull); - } catch (e) { + } catch { if (!args.deleteMSG) await (message as BushMessage).react(this.client.util.emojis.errorFull); } } diff --git a/src/commands/dev/reload.ts b/src/commands/dev/reload.ts index 4a69098..fdb669f 100644 --- a/src/commands/dev/reload.ts +++ b/src/commands/dev/reload.ts @@ -46,11 +46,7 @@ export default class ReloadCommand extends BushCommand { return message.util.send(`🔁 Successfully reloaded! (${new Date().getTime() - s.getTime()}ms)`); } catch (e) { return message.util.send( - `An error occurred while reloading:\n${await this.client.util.codeblock( - typeof e === 'object' ? e?.stack : e, - 2048 - 34, - 'js' - )}` + `An error occurred while reloading:\n${await this.client.util.codeblock(e?.stack || e, 2048 - 34, 'js')}` ); } } diff --git a/src/commands/dev/setLevel.ts b/src/commands/dev/setLevel.ts index 2a807f8..871a9de 100644 --- a/src/commands/dev/setLevel.ts +++ b/src/commands/dev/setLevel.ts @@ -36,13 +36,13 @@ export default class SetLevelCommand extends BushCommand { ownerOnly: true, slashOptions: [ { - type: /* 'USER' */ 'USER', + type: 'USER', name: 'user', description: 'The user to change the level of', required: true }, { - type: /* 'INTEGER' */ 'INTEGER', + type: 'INTEGER', name: 'level', description: 'The level to set the user to', required: true diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index f88819b..f8bb5a1 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -76,13 +76,13 @@ export default class KickCommand extends BushCommand { // }); // await modlogEnry.save(); // } catch (e) { - // this.client.console.error(`KickCommand`, `Error saving to database. ${typeof e === 'object' ? e?.stack : e}`); + // this.client.console.error(`KickCommand`, `Error saving to database. ${e?.stack || e}`); // yield `${this.client.util.emojis.error} Error saving to database. Please report this to a developer.`; // return; // } // try { // await user.send(`You were kicked in ${message.guild.name} with reason \`${reason || 'No reason given'}\``); - // } catch (e) { + // } catch { // yield `${this.client.util.emojis.warn} Unable to dm user`; // } // try { diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts index 8ac77a7..5e5cdba 100644 --- a/src/commands/moderation/mute.ts +++ b/src/commands/moderation/mute.ts @@ -9,6 +9,11 @@ export default class MuteCommand extends BushCommand { super('mute', { aliases: ['mute'], category: 'moderation', + description: { + content: 'Mute a user.', + usage: 'mute <member> <reason> [--time]', + examples: ['mute @user bad boi --time 1h'] + }, args: [ { id: 'user', @@ -23,30 +28,25 @@ export default class MuteCommand extends BushCommand { type: 'contentWithDuration', match: 'rest', prompt: { - start: 'Why would you like to mute this user?', - retry: '{error} Choose a mute reason and duration.', + start: 'Why should this user be muted and for how long?', + retry: '{error} Choose a valid mute reason and duration.', optional: true } } ], clientPermissions: ['MANAGE_ROLES'], userPermissions: ['MANAGE_MESSAGES'], - description: { - content: 'Mute a user.', - usage: 'mute <member> <reason> [--time]', - examples: ['mute @user bad boi --time 1h'] - }, slashOptions: [ { type: 'USER', name: 'user', - description: 'The user to mute.', + description: 'What user would you like to mute?', required: true }, { type: 'STRING', name: 'reason', - description: 'Why is the user is getting muted, and how long should they be muted for?', + description: 'Why should this user be muted and for how long?', required: false } ], @@ -76,7 +76,7 @@ export default class MuteCommand extends BushCommand { return message.util.reply(`${error} You cannot mute yourself.`); } - let time; + let time: number; if (reason) { time = typeof reason === 'string' diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts index d70c9f0..9df5891 100644 --- a/src/commands/moderation/warn.ts +++ b/src/commands/moderation/warn.ts @@ -47,13 +47,13 @@ export default class WarnCommand extends BushCommand { reason }); await entry.save(); - } catch (e) { + } catch { await message.util.send('Error saving to database, please contact the developers'); return; } try { await member.send(`You were warned in ${message.guild.name} for reason "${reason}".`); - } catch (e) { + } catch { await message.util.send('Error messaging user, warning still saved.'); return; } |