Fix ban checker

This commit is contained in:
Tarrgon
2025-05-30 14:38:42 -04:00
parent 50945f297e
commit 7d670bbe29
+7 -2
View File
@@ -45,9 +45,14 @@ async function getDiscordAlts(e621Id: number, guild: Guild, depth = 1, ignore: n
for (const discordId of discordIds) { for (const discordId of discordIds) {
const alts = await getE621Alts(discordId, guild, depth + 1, ignore); const alts = await getE621Alts(discordId, guild, depth + 1, ignore);
const banned = await guild.bans.fetch(discordId); let banned = false;
content += `${'- '.repeat(depth)}<@${discordId}>${banned ? ' [BANNED]' : ''}\n${alts}`; // It's either this or fetch all the bans and sift through them for every discord alt.
try {
banned = !!(await guild.bans.fetch(discordId));
} catch (e) { }
if (alts || banned) content += `${'- '.repeat(depth)}<@${discordId}>${banned ? ' [BANNED]' : ''}\n${alts}`;
} }
return content; return content;