Fix all missing await issues (eslint)
diff --git a/src/commands/settings/automod.ts b/src/commands/settings/automod.ts
index d8464f0..6860a26 100644
--- a/src/commands/settings/automod.ts
+++ b/src/commands/settings/automod.ts
@@ -1076,12 +1076,12 @@
} else {
switch (i.values[0]) {
case "invites": {
- i.deferUpdate();
+ await i.deferUpdate();
config.invite = await inviteMenu(i, m, config.invite);
break;
}
case "mentions": {
- i.deferUpdate();
+ await i.deferUpdate();
config.pings = await mentionMenu(i, m, config.pings);
break;
}
diff --git a/src/commands/settings/rolemenu.ts b/src/commands/settings/rolemenu.ts
index e683e4f..7da9dfe 100644
--- a/src/commands/settings/rolemenu.ts
+++ b/src/commands/settings/rolemenu.ts
@@ -89,7 +89,7 @@
out = null;
}
if (!out) return;
- out.deferUpdate();
+ await out.deferUpdate();
if (out.isButton()) return;
const values = out.values;
@@ -218,7 +218,7 @@
`**Max:** ${data.max}\n`
);
- interaction.editReply({ embeds: [embed], components: [previewSelect, buttons] });
+ await interaction.editReply({ embeds: [embed], components: [previewSelect, buttons] });
let i: StringSelectMenuInteraction | ButtonInteraction;
try {
i = (await m.awaitMessageComponent({
@@ -304,7 +304,7 @@
}\n`
);
- interaction.editReply({
+ await interaction.editReply({
embeds: [embed],
components: [new ActionRowBuilder<RoleSelectMenuBuilder>().addComponents(roleSelect), buttons]
});
diff --git a/src/commands/settings/stats.ts b/src/commands/settings/stats.ts
index d4e4439..ed2fc6f 100644
--- a/src/commands/settings/stats.ts
+++ b/src/commands/settings/stats.ts
@@ -198,7 +198,7 @@
)
]
});
- showModal(i, { name: newChannelName, enabled: newChannelEnabled });
+ await showModal(i, { name: newChannelName, enabled: newChannelEnabled });
const out: Discord.ModalSubmitInteraction | ButtonInteraction | null =
await modalInteractionCollector(m, interaction.user);
@@ -336,7 +336,7 @@
}
}
- interaction.editReply({
+ await interaction.editReply({
embeds: [embed],
components: [
new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(pageSelect),
@@ -367,7 +367,7 @@
modified = true;
switch (i.values[0]!) {
case "edit": {
- showModal(i, current!);
+ await showModal(i, current!);
await interaction.editReply({
embeds: [
new EmojiEmbed()
@@ -439,7 +439,7 @@
}
case "save": {
await client.database.guilds.write(interaction.guild.id, { stats: currentObject });
- singleNotify("statsChannelDeleted", interaction.guild.id, true);
+ await singleNotify("statsChannelDeleted", interaction.guild.id, true);
modified = false;
await client.memory.forceUpdate(interaction.guild.id);
break;
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
index 625bcfb..60a7eae 100644
--- a/src/commands/settings/tracks.ts
+++ b/src/commands/settings/tracks.ts
@@ -142,7 +142,7 @@
out = null;
}
if (!out) return;
- out.deferUpdate();
+ await out.deferUpdate();
if (out.isButton()) return;
const values = out.values;
@@ -268,7 +268,7 @@
];
if (current.track.length >= 1) comps.splice(1, 0, selectMenu);
- interaction.editReply({ embeds: [embed], components: comps });
+ await interaction.editReply({ embeds: [embed], components: comps });
let out: ButtonInteraction | RoleSelectMenuInteraction | StringSelectMenuInteraction | null;
@@ -286,7 +286,7 @@
if (out.isButton()) {
switch (out.customId) {
case "back": {
- out.deferUpdate();
+ await out.deferUpdate();
closed = true;
break;
}
@@ -295,23 +295,23 @@
break;
}
case "reorder": {
- out.deferUpdate();
+ await out.deferUpdate();
current.track = (await reorderTracks(interaction, out, message, roles, current.track))!;
break;
}
case "retainPrevious": {
- out.deferUpdate();
+ await out.deferUpdate();
current.retainPrevious = !current.retainPrevious;
break;
}
case "nullable": {
- out.deferUpdate();
+ await out.deferUpdate();
current.nullable = !current.nullable;
break;
}
}
} else if (out.isStringSelectMenu()) {
- out.deferUpdate();
+ await out.deferUpdate();
switch (out.customId) {
case "removeRole": {
const index = current.track.findIndex(
@@ -322,7 +322,7 @@
}
}
} else {
- out.deferUpdate();
+ await out.deferUpdate();
switch (out.customId) {
case "addRole": {
const role = out.values![0]!;
@@ -476,7 +476,7 @@
break;
}
case "save": {
- client.database.guilds.write(interaction.guild!.id, { tracks: tracks });
+ await client.database.guilds.write(interaction.guild!.id, { tracks: tracks });
modified = false;
await client.memory.forceUpdate(interaction.guild!.id);
break;
diff --git a/src/commands/settings/verify.ts b/src/commands/settings/verify.ts
index e2318fc..05c4764 100644
--- a/src/commands/settings/verify.ts
+++ b/src/commands/settings/verify.ts
@@ -82,7 +82,7 @@
if (i.isButton()) {
switch (i.customId) {
case "save": {
- client.database.guilds.write(interaction.guild.id, { verify: data });
+ await client.database.guilds.write(interaction.guild.id, { verify: data });
config = await client.database.guilds.read(interaction.guild.id);
data = Object.assign({}, config.verify);
await client.memory.forceUpdate(interaction.guild.id);