Fix all missing await issues (eslint)
diff --git a/src/reflex/guide.ts b/src/reflex/guide.ts
index 1901d34..59c12c7 100644
--- a/src/reflex/guide.ts
+++ b/src/reflex/guide.ts
@@ -353,12 +353,12 @@
const em = new Discord.EmbedBuilder(pages[page]!.embed);
em.setDescription(em.data.description + "\n\n" + createPageIndicator(pages.length, page));
em.setFooter({ text: "Message closed" });
- interaction.editReply({
+ await interaction.editReply({
embeds: [em],
components: []
});
} else {
- m.delete();
+ await m.delete();
}
}
};
diff --git a/src/reflex/scanners.ts b/src/reflex/scanners.ts
index 59bfa2a..23337ac 100644
--- a/src/reflex/scanners.ts
+++ b/src/reflex/scanners.ts
@@ -55,7 +55,7 @@
} catch (e) {
return { safe: true };
}
- client.database.scanCache.write(hash, "malware", malware);
+ await client.database.scanCache.write(hash, "malware", malware);
return { safe: !malware };
}
@@ -75,7 +75,7 @@
console.error(err);
return { safe: true, tags: [] };
});
- client.database.scanCache.write(link, "bad_link", scanned.safe ?? true, scanned.tags ?? []);
+ await client.database.scanCache.write(link, "bad_link", scanned.safe ?? true, scanned.tags ?? []);
return {
safe: scanned.safe ?? true,
tags: scanned.tags ?? []
@@ -90,7 +90,7 @@
export async function saveAttachment(link: string): Promise<[string, string]> {
const image = await (await fetch(link)).arrayBuffer();
- const fileName = generateFileName(link.split("/").pop()!.split(".").pop()!);
+ const fileName = await generateFileName(link.split("/").pop()!.split(".").pop()!);
const enc = new TextDecoder("utf-8");
writeFileSync(fileName, new DataView(image), "base64");
return [fileName, createHash("sha512").update(enc.decode(image), "base64").digest("base64")];
diff --git a/src/reflex/statsChannelUpdate.ts b/src/reflex/statsChannelUpdate.ts
index e3c7a2a..f2650a8 100644
--- a/src/reflex/statsChannelUpdate.ts
+++ b/src/reflex/statsChannelUpdate.ts
@@ -12,7 +12,7 @@
export async function callback(user: User, guild: Guild) {
guild = await client.guilds.fetch(guild.id);
const config = await client.database.guilds.read(guild.id);
- Object.entries(config.stats).forEach(async ([channel, props]) => {
+ Object.entries(config.stats).forEach(([channel, props]) => void (async () => {
if ((props as PropSchema).enabled) {
let string = (props as PropSchema).name;
if (!string) return;
@@ -41,5 +41,5 @@
console.error(e);
}
}
- });
+ })());
}
diff --git a/src/reflex/verify.ts b/src/reflex/verify.ts
index a5991de..540fb4d 100644
--- a/src/reflex/verify.ts
+++ b/src/reflex/verify.ts
@@ -208,7 +208,7 @@
.setEmoji("CONTROL.BLOCKCROSS")
]
});
- singleNotify(
+ await singleNotify(
"verifyRoleDeleted",
interaction.guild!.id,
`The role given when a member is verified has been deleted. Use ${getCommandMentionByName(
diff --git a/src/reflex/welcome.ts b/src/reflex/welcome.ts
index 8e471c6..33f1651 100644
--- a/src/reflex/welcome.ts
+++ b/src/reflex/welcome.ts
@@ -45,7 +45,7 @@
content: (config.welcome.ping ? `<@&${config.welcome.ping}>` : "") + `<@${member.id}>`
});
} catch (err) {
- singleNotify(
+ await singleNotify(
"welcomeChannelDeleted",
member.guild.id,
`The welcome channel has been deleted or is no longer accessible. Use ${getCommandMentionByName(