aboutsummaryrefslogtreecommitdiff
path: root/src/commands
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
parent80d5b5b11ae261945dc725a0a80115922003afcf (diff)
downloadtanzanite-7990abdb511eeec2a114b124a3628b10bfefc342.tar.gz
tanzanite-7990abdb511eeec2a114b124a3628b10bfefc342.tar.bz2
tanzanite-7990abdb511eeec2a114b124a3628b10bfefc342.zip
chore: add new eslint rule
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/admin/channelPermissions.ts9
-rw-r--r--src/commands/dev/reload.ts2
-rw-r--r--src/commands/info/pronouns.ts8
-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
-rw-r--r--src/commands/moulberry-bush/report.ts2
-rw-r--r--src/commands/skyblock-reborn/chooseColorCommand.ts2
9 files changed, 20 insertions, 15 deletions
diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts
index c397855..08d0068 100644
--- a/src/commands/admin/channelPermissions.ts
+++ b/src/commands/admin/channelPermissions.ts
@@ -65,7 +65,7 @@ export default class ChannelPermissionsCommand extends BushCommand {
permission: string;
state: 'true' | 'false' | 'neutral';
}
- ): Promise<void> {
+ ): Promise<unknown> {
const failedChannels = [];
for (const channel of message.guild.channels.cache.array()) {
try {
@@ -89,9 +89,12 @@ export default class ChannelPermissionsCommand extends BushCommand {
paginate.push(new MessageEmbed().setDescription(failure.substring(i, Math.min(failure.length, i + 2000))));
}
const normalMessage = `Finished changing perms! Failed channels:`;
- util.buttonPaginate(message, paginate, normalMessage);
+ return await client.util.buttonPaginate(message, paginate, normalMessage);
} else {
- await message.util.reply({ content: `Finished changing perms! Failed channels:`, embeds: [{ description: failure }] });
+ return await message.util.reply({
+ content: `Finished changing perms! Failed channels:`,
+ embeds: [{ description: failure }]
+ });
}
}
}
diff --git a/src/commands/dev/reload.ts b/src/commands/dev/reload.ts
index 2be67fa..4748aba 100644
--- a/src/commands/dev/reload.ts
+++ b/src/commands/dev/reload.ts
@@ -44,7 +44,7 @@ export default class ReloadCommand extends BushCommand {
client.inhibitorHandler.reloadAll();
return message.util.send(`🔁 Successfully reloaded! (${new Date().getTime() - s.getTime()}ms)`);
} catch (e) {
- if (output) await client.logger.error('reloadCommand', output);
+ if (output) void client.logger.error('reloadCommand', output);
return message.util.send(`An error occurred while reloading:\n${await util.codeblock(e?.stack || e, 2048 - 34, 'js')}`);
}
}
diff --git a/src/commands/info/pronouns.ts b/src/commands/info/pronouns.ts
index 0a5c0bc..82ee04f 100644
--- a/src/commands/info/pronouns.ts
+++ b/src/commands/info/pronouns.ts
@@ -60,14 +60,14 @@ export default class PronounsCommand extends BushCommand {
slash: true
});
}
- async exec(message: Message | BushSlashMessage, args: { user?: User }): Promise<void> {
+ async exec(message: Message | BushSlashMessage, args: { user?: User }): Promise<unknown> {
const user = args.user || message.author;
const author = user.id === message.author.id;
try {
const apiRes: { pronouns: pronounsType } = await got
.get(`https://pronoundb.org/api/v1/lookup?platform=discord&id=${user.id}`)
.json();
- message.util.reply({
+ return await message.util.reply({
embeds: [
new MessageEmbed({
title: `${author ? 'Your' : `${user.tag}'s`} pronouns:`,
@@ -81,11 +81,11 @@ export default class PronounsCommand extends BushCommand {
} catch (e) {
if (e instanceof HTTPError && e.response.statusCode === 404) {
if (author) {
- await message.util.reply(
+ return await message.util.reply(
'You do not appear to have any pronouns set. Please go to https://pronoundb.org/ and set your pronouns.'
);
} else {
- await message.util.reply(
+ return await message.util.reply(
`${user.tag} does not appear to have any pronouns set. Please tell them to go to https://pronoundb.org/ and set their pronouns.`
);
}
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() });
}
}
diff --git a/src/commands/moulberry-bush/report.ts b/src/commands/moulberry-bush/report.ts
index 64dcdff..4c6adc1 100644
--- a/src/commands/moulberry-bush/report.ts
+++ b/src/commands/moulberry-bush/report.ts
@@ -111,7 +111,7 @@ export default class ReportCommand extends BushCommand {
await ReportMessage.react(util.emojis.success);
await ReportMessage.react(util.emojis.error);
} catch {
- client.console.warn('ReportCommand', 'Could not react to report message.');
+ void client.console.warn('ReportCommand', 'Could not react to report message.');
}
});
return await message.util.reply('Successfully made a report.');
diff --git a/src/commands/skyblock-reborn/chooseColorCommand.ts b/src/commands/skyblock-reborn/chooseColorCommand.ts
index 344fa60..0138e36 100644
--- a/src/commands/skyblock-reborn/chooseColorCommand.ts
+++ b/src/commands/skyblock-reborn/chooseColorCommand.ts
@@ -171,7 +171,7 @@ export default class ChooseColorCommand extends BushCommand {
);
}
- message.util.reply({
+ return await message.util.reply({
content: `${util.emojis.success} Assigned you the <@&${colorID}> role.`,
allowedMentions: AllowedMentions.none()
});