aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-04 16:26:56 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-04 16:26:56 -0400
commit153a40fbcd314459f94d9a2b44d3466c930c4e35 (patch)
tree5c853355da693e68c393b38c0c66a1f84ef0ac89 /src/commands/moderation
parentcf564dbb6435886f97e2e9870363144386af368d (diff)
downloadtanzanite-153a40fbcd314459f94d9a2b44d3466c930c4e35.tar.gz
tanzanite-153a40fbcd314459f94d9a2b44d3466c930c4e35.tar.bz2
tanzanite-153a40fbcd314459f94d9a2b44d3466c930c4e35.zip
cleaned up
Diffstat (limited to 'src/commands/moderation')
-rw-r--r--src/commands/moderation/kick.ts4
-rw-r--r--src/commands/moderation/mute.ts20
-rw-r--r--src/commands/moderation/warn.ts4
3 files changed, 14 insertions, 14 deletions
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;
}