Fix the last of the eslint errors (for real this time)
diff --git a/src/commands/settings/logs/attachment.ts b/src/commands/settings/logs/attachment.ts
index 52fdd5f..843b391 100644
--- a/src/commands/settings/logs/attachment.ts
+++ b/src/commands/settings/logs/attachment.ts
@@ -117,7 +117,9 @@
let clicks = 0;
const data = await client.database.guilds.read(interaction.guild.id);
let channel = data.logging.staff.channel;
- while (true) {
+
+ let timedOut = false;
+ while (!timedOut) {
await interaction.editReply({
embeds: [
new EmojiEmbed()
@@ -148,7 +150,8 @@
try {
i = await m.awaitMessageComponent({ time: 300000 });
} catch (e) {
- break;
+ timedOut = true;
+ continue;
}
i.deferUpdate();
if (i.component.customId === "clear") {
@@ -158,8 +161,6 @@
await client.database.guilds.write(interaction.guild.id, null, ["logging.announcements.channel"]);
channel = undefined;
}
- } else {
- break;
}
}
await interaction.editReply({
diff --git a/src/commands/settings/logs/channel.ts b/src/commands/settings/logs/channel.ts
index c645581..206d282 100644
--- a/src/commands/settings/logs/channel.ts
+++ b/src/commands/settings/logs/channel.ts
@@ -114,7 +114,8 @@
let clicks = 0;
const data = await client.database.guilds.read(interaction.guild.id);
let channel = data.logging.logs.channel;
- while (true) {
+ let timedOut = false;
+ while (!timedOut) {
await interaction.editReply({
embeds: [
new EmojiEmbed()
@@ -142,7 +143,7 @@
try {
i = await m.awaitMessageComponent({ time: 300000 });
} catch (e) {
- break;
+ timedOut = true;
}
i.deferUpdate();
if (i.component.customId === "clear") {
@@ -152,8 +153,6 @@
await client.database.guilds.write(interaction.guild.id, null, ["logging.logs.channel"]);
channel = undefined;
}
- } else {
- break;
}
}
await interaction.editReply({
diff --git a/src/commands/settings/logs/events.ts b/src/commands/settings/logs/events.ts
index c3fbe41..d0db316 100644
--- a/src/commands/settings/logs/events.ts
+++ b/src/commands/settings/logs/events.ts
@@ -1,5 +1,5 @@
import { LoadingEmbed } from "./../../../utils/defaultEmbeds.js";
-import Discord, { CommandInteraction, MessageActionRow, MessageButton, MessageSelectMenu } from "discord.js";
+import Discord, { CommandInteraction, Message, MessageActionRow, MessageButton, MessageSelectMenu } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
import EmojiEmbed from "../../../utils/generateEmojiEmbed.js";
@@ -38,11 +38,12 @@
fetchReply: true,
ephemeral: true
});
- let m;
- while (true) {
+ let m: Message;
+ let timedOut = false;
+ do {
const config = await client.database.guilds.read(interaction.guild.id);
const converted = toHexArray(config.logging.logs.toLog);
- m = await interaction.editReply({
+ m = (await interaction.editReply({
embeds: [
new EmojiEmbed()
.setTitle("Logging Events")
@@ -72,12 +73,13 @@
new MessageButton().setLabel("Select none").setStyle("DANGER").setCustomId("none")
])
]
- });
+ })) as Message;
let i;
try {
i = await m.awaitMessageComponent({ time: 300000 });
} catch (e) {
- break;
+ timedOut = true;
+ continue;
}
i.deferUpdate();
if (i.customId === "logs") {
@@ -95,22 +97,10 @@
await client.database.guilds.write(interaction.guild.id, {
"logging.logs.toLog": 0
});
- } else {
- break;
}
- }
- m = await interaction.editReply({
- embeds: [
- new EmojiEmbed()
- .setTitle("Logging Events")
- .setDescription(
- "Below are the events being logged in the server. You can toggle them on and off in the dropdown"
- )
- .setFooter({ text: "Message timed out" })
- .setStatus("Success")
- .setEmoji("CHANNEL.TEXT.CREATE")
- ]
- });
+ } while (!timedOut);
+
+ await interaction.editReply({ embeds: [m.embeds[0]!.setFooter({ text: "Message timed out" })] });
return;
};
diff --git a/src/commands/settings/logs/staff.ts b/src/commands/settings/logs/staff.ts
index 715fbea..c7077cf 100644
--- a/src/commands/settings/logs/staff.ts
+++ b/src/commands/settings/logs/staff.ts
@@ -119,7 +119,8 @@
let clicks = 0;
const data = await client.database.guilds.read(interaction.guild.id);
let channel = data.logging.staff.channel;
- while (true) {
+ let timedOut = false;
+ while (!timedOut) {
await interaction.editReply({
embeds: [
new EmojiEmbed()
@@ -147,7 +148,8 @@
try {
i = await m.awaitMessageComponent({ time: 300000 });
} catch (e) {
- break;
+ timedOut = true;
+ continue;
}
i.deferUpdate();
if ((i.component as MessageButton).customId === "clear") {
@@ -157,8 +159,6 @@
await client.database.guilds.write(interaction.guild.id, null, ["logging.staff.channel"]);
channel = undefined;
}
- } else {
- break;
}
}
await interaction.editReply({