From 153a40fbcd314459f94d9a2b44d3466c930c4e35 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sun, 4 Jul 2021 16:26:56 -0400 Subject: cleaned up --- src/commands/moderation/kick.ts | 4 ++-- src/commands/moderation/mute.ts | 20 ++++++++++---------- src/commands/moderation/warn.ts | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/commands/moderation') 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 [--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 [--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; } -- cgit