Cast another net

This commit is contained in:
powermaker450 2024-10-13 15:39:27 -04:00
parent 70dce2667e
commit f4cc93b07d

View file

@ -65,14 +65,18 @@ BotClient.on(Events.InteractionCreate, async interaction => {
}); });
BotClient.on(Events.MessageDelete, async message => { BotClient.on(Events.MessageDelete, async message => {
const guildId = message.guild?.id!; try {
const messageId = message.id; const guildId = message.guild?.id!;
const confessions = dt.getGuildInfo(guildId)?.confessions!; const messageId = message.id;
const confessions = dt.getGuildInfo(guildId)?.confessions!;
for (const confession of confessions) { for (const confession of confessions) {
if (confession.messageId === messageId) { if (confession.messageId === messageId) {
dt.adminDelConfession(guildId, confession.id); dt.adminDelConfession(guildId, confession.id);
}
} }
} catch (err) {
logger.error("An error occured:", err);
} }
}); });