aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-26 22:53:27 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-26 22:53:27 -0400
commit7990abdb511eeec2a114b124a3628b10bfefc342 (patch)
treec9cc92439bb0b8385e8fcd82c169fd6f86bb1974 /src/commands/moderation
parent80d5b5b11ae261945dc725a0a80115922003afcf (diff)
downloadtanzanite-7990abdb511eeec2a114b124a3628b10bfefc342.tar.gz
tanzanite-7990abdb511eeec2a114b124a3628b10bfefc342.tar.bz2
tanzanite-7990abdb511eeec2a114b124a3628b10bfefc342.zip
chore: add new eslint rule
Diffstat (limited to 'src/commands/moderation')
-rw-r--r--src/commands/moderation/kick.ts2
-rw-r--r--src/commands/moderation/lockdown.ts2
-rw-r--r--src/commands/moderation/mute.ts2
-rw-r--r--src/commands/moderation/unmute.ts6
4 files changed, 7 insertions, 5 deletions
diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts
index bc7d9d2..5fd83b7 100644
--- a/src/commands/moderation/kick.ts
+++ b/src/commands/moderation/kick.ts
@@ -61,7 +61,7 @@ export default class KickCommand extends BushCommand {
): Promise<unknown> {
const member = message.guild.members.cache.get(user.id) as BushGuildMember;
- if (!member) message.util.reply(`${util.emojis.error} You cannot kick members that are not in the server.`);
+ if (!member) return await message.util.reply(`${util.emojis.error} You cannot kick members that are not in the server.`);
const useForce = force && message.author.isOwner();
const canModerateResponse = util.moderationPermissionCheck(message.member, member, 'kick', true, useForce);
diff --git a/src/commands/moderation/lockdown.ts b/src/commands/moderation/lockdown.ts
index 4eaeceb..db074b1 100644
--- a/src/commands/moderation/lockdown.ts
+++ b/src/commands/moderation/lockdown.ts
@@ -36,6 +36,8 @@ export default class LockdownCommand extends BushCommand {
if (!all) {
if (!['GUILD_TEXT', 'GUILD_NEWS'].includes(message.channel.type))
return message.util.reply(`${util.emojis.error} You can only lock down text and announcement channels.`);
+
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
const lockdownSuccess = await util.lockdownChannel({
channel: message.channel as BushTextChannel | BushNewsChannel,
moderator: message.author
diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts
index 779f60d..31cd233 100644
--- a/src/commands/moderation/mute.ts
+++ b/src/commands/moderation/mute.ts
@@ -61,7 +61,7 @@ export default class MuteCommand extends BushCommand {
{ user, reason, force }: { user: BushUser; reason?: { duration: number; contentWithoutTime: string }; force: boolean }
): Promise<unknown> {
const member = message.guild.members.cache.get(user.id) as BushGuildMember;
- if (!member) message.util.reply(`${util.emojis.error} You cannot kick members that are not in the server.`);
+ if (!member) return await message.util.reply(`${util.emojis.error} You cannot kick members that are not in the server.`);
const useForce = force && message.author.isOwner();
const canModerateResponse = util.moderationPermissionCheck(message.member, member, 'mute', true, useForce);
diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts
index 807cf2c..528317c 100644
--- a/src/commands/moderation/unmute.ts
+++ b/src/commands/moderation/unmute.ts
@@ -65,8 +65,8 @@ export default class UnmuteCommand extends BushCommand {
moderator: message.author
});
- const responseMessage = () => {
- const prefix = message.guild.getSetting('prefix');
+ const responseMessage = async () => {
+ const prefix = await message.guild.getSetting('prefix');
switch (responseCode) {
case 'missing permissions':
return `${error} Could not unmute ${victimBoldTag} because I am missing the \`Manage Roles\` permission.`;
@@ -88,6 +88,6 @@ export default class UnmuteCommand extends BushCommand {
return `${util.emojis.success} Successfully unmuted **${member.user.tag}**.`;
}
};
- return await message.util.reply({ content: responseMessage(), allowedMentions: AllowedMentions.none() });
+ return await message.util.reply({ content: await responseMessage(), allowedMentions: AllowedMentions.none() });
}
}