Fix all missing await issues (eslint)
diff --git a/src/commands/mod/about.ts b/src/commands/mod/about.ts
index 8736054..6f8b74c 100644
--- a/src/commands/mod/about.ts
+++ b/src/commands/mod/about.ts
@@ -266,7 +266,7 @@
}
});
} catch (e) {
- interaction.editReply({
+ await interaction.editReply({
embeds: [
new EmojiEmbed()
.setEmoji("MEMBER.JOIN")
diff --git a/src/commands/mod/ban.ts b/src/commands/mod/ban.ts
index 91e074d..41d1252 100644
--- a/src/commands/mod/ban.ts
+++ b/src/commands/mod/ban.ts
@@ -126,7 +126,7 @@
dmSent = false;
}
try {
- member.ban({
+ await member.ban({
deleteMessageSeconds: deleteDays * 24 * 60 * 60,
reason: reason ?? "*No reason provided*"
});
@@ -159,7 +159,7 @@
guild: interaction.guild.id
}
};
- log(data);
+ await log(data);
} catch {
await interaction.editReply({
embeds: [
diff --git a/src/commands/mod/kick.ts b/src/commands/mod/kick.ts
index 4ef78c8..f9242fe 100644
--- a/src/commands/mod/kick.ts
+++ b/src/commands/mod/kick.ts
@@ -114,7 +114,7 @@
dmSent = false;
}
try {
- member.kick(reason || "No reason provided");
+ await member.kick(reason || "No reason provided");
await client.database.history.create("kick", interaction.guild.id, member.user, interaction.user, reason);
const { log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
const timeInServer = member.joinedTimestamp
@@ -157,7 +157,7 @@
data.list.joined = entry(member.joinedTimestamp.toString(), renderDelta(member.joinedTimestamp));
}
await client.database.history.create("kick", interaction.guild.id, member.user, interaction.user, reason);
- log(data);
+ await log(data);
} catch {
await interaction.editReply({
embeds: [
diff --git a/src/commands/mod/mute.ts b/src/commands/mod/mute.ts
index 2266a1a..0cfe660 100644
--- a/src/commands/mod/mute.ts
+++ b/src/commands/mod/mute.ts
@@ -132,7 +132,7 @@
} catch {
return;
}
- component.deferUpdate();
+ await component.deferUpdate();
if (component.customId === "cancel")
return interaction.editReply({
embeds: [
@@ -389,7 +389,7 @@
guild: interaction.guild.id
}
};
- log(data);
+ await log(data);
const failed = !status.dm && notify;
await interaction.editReply({
embeds: [
diff --git a/src/commands/mod/nick.ts b/src/commands/mod/nick.ts
index cfdcf47..a8d4ab8 100644
--- a/src/commands/mod/nick.ts
+++ b/src/commands/mod/nick.ts
@@ -153,7 +153,7 @@
let before: string | null;
try {
before = member.nickname;
- member.setNickname(newNickname ?? null, "Nucleus Nickname command");
+ await member.setNickname(newNickname ?? null, "Nucleus Nickname command");
await client.database.history.create(
"nickname",
interaction.guild!.id,
@@ -202,7 +202,7 @@
guild: interaction.guild!.id
}
};
- log(data);
+ await log(data);
const failed = !dmSent && notify;
await interaction.editReply({
embeds: [
diff --git a/src/commands/mod/purge.ts b/src/commands/mod/purge.ts
index dadab04..1170c33 100644
--- a/src/commands/mod/purge.ts
+++ b/src/commands/mod/purge.ts
@@ -100,7 +100,7 @@
})) as Discord.Message;
let component;
try {
- component = m.awaitMessageComponent({
+ component = await m.awaitMessageComponent({
filter: (i) => i.user.id === interaction.user.id && i.channel!.id === interaction.channel!.id,
time: 300000
});
@@ -108,12 +108,12 @@
timedOut = true;
continue;
}
- (await component).deferUpdate();
- if ((await component).customId === "done") {
+ await component.deferUpdate();
+ if (component.customId === "done") {
amountSelected = true;
continue;
}
- const amount = parseInt((await component).customId);
+ const amount = parseInt(component.customId);
let messages: Discord.Message[] = [];
await (interaction.channel as TextChannel).messages.fetch({ limit: amount }).then(async (ms) => {
@@ -167,7 +167,7 @@
guild: interaction.guild.id
}
};
- log(data);
+ await log(data);
const newOut = await client.database.transcripts.createTranscript(
"purge",
deleted,
@@ -209,7 +209,7 @@
return;
}
if (component.customId === "download") {
- interaction.editReply({
+ await interaction.editReply({
embeds: [
new EmojiEmbed()
.setEmoji("CHANNEL.PURGE.GREEN")
@@ -221,7 +221,7 @@
files: [attachmentObject]
});
} else {
- interaction.editReply({
+ await interaction.editReply({
embeds: [
new EmojiEmbed()
.setEmoji("CHANNEL.PURGE.GREEN")
@@ -261,12 +261,12 @@
messages = await (channel as TextChannel).bulkDelete(toDelete, true);
} else {
const toDelete = (
- await (
- await (interaction.channel as TextChannel).messages.fetch({
- limit: 100
- })
- ).filter((m) => m.author.id === user.id)
- ).first(interaction.options.get("amount")?.value as number);
+ await (interaction.channel as TextChannel).messages.fetch({
+ limit: 100
+ })
+ )
+ .filter((m) => m.author.id === user.id)
+ .first(interaction.options.get("amount")?.value as number);
messages = await (channel as TextChannel).bulkDelete(toDelete, true);
}
} catch (e) {
@@ -326,7 +326,7 @@
guild: interaction.guild.id
}
};
- log(data);
+ await log(data);
const messageArray: Message[] = messages
.filter(
(message) =>
diff --git a/src/commands/mod/slowmode.ts b/src/commands/mod/slowmode.ts
index ba88c00..8fe9f16 100644
--- a/src/commands/mod/slowmode.ts
+++ b/src/commands/mod/slowmode.ts
@@ -51,7 +51,7 @@
.send();
if (confirmation.cancelled || !confirmation.success) return;
try {
- (interaction.channel as TextChannel).setRateLimitPerUser(time);
+ await (interaction.channel as TextChannel).setRateLimitPerUser(time);
} catch (e) {
await interaction.editReply({
embeds: [
diff --git a/src/commands/mod/softban.ts b/src/commands/mod/softban.ts
index cd03d1a..984bb6b 100644
--- a/src/commands/mod/softban.ts
+++ b/src/commands/mod/softban.ts
@@ -128,7 +128,7 @@
try {
const member = interaction.options.getMember("user") as GuildMember;
const days: number = (interaction.options.get("delete")?.value as number | null) ?? 0;
- member.ban({
+ await member.ban({
deleteMessageSeconds: days * 24 * 60 * 60,
reason: reason ?? "*No reason provided*"
});
@@ -162,7 +162,7 @@
guild: interaction.guild.id
}
};
- log(data);
+ await log(data);
} catch {
await interaction.editReply({
embeds: [
diff --git a/src/commands/mod/unban.ts b/src/commands/mod/unban.ts
index 7397414..1c1a877 100644
--- a/src/commands/mod/unban.ts
+++ b/src/commands/mod/unban.ts
@@ -76,7 +76,7 @@
guild: interaction.guild.id
}
};
- log(data);
+ await log(data);
} catch {
await interaction.editReply({
embeds: [
diff --git a/src/commands/mod/unmute.ts b/src/commands/mod/unmute.ts
index f248a3b..516bd39 100644
--- a/src/commands/mod/unmute.ts
+++ b/src/commands/mod/unmute.ts
@@ -76,7 +76,7 @@
}
const member = interaction.options.getMember("user") as GuildMember;
try {
- member.timeout(0, reason ?? "*No reason provided*");
+ await member.timeout(0, reason ?? "*No reason provided*");
} catch {
await interaction.editReply({
embeds: [
@@ -122,7 +122,7 @@
guild: interaction.guild.id
}
};
- log(data);
+ await log(data);
const failed = !dmSent && notify;
await interaction.editReply({
embeds: [
diff --git a/src/commands/mod/warn.ts b/src/commands/mod/warn.ts
index 232219b..0424d48 100644
--- a/src/commands/mod/warn.ts
+++ b/src/commands/mod/warn.ts
@@ -153,7 +153,7 @@
}
};
await client.database.history.create("warn", interaction.guild.id, member.user, interaction.user, reason);
- log(data);
+ await log(data);
const failed = !dmSent && notify;
if (!failed) {
await interaction.editReply({