Skip to content

Commit 219b413

Browse files
committed
fix: only send ban event to the bot if the user was actually banned
1 parent 2000cd9 commit 219b413

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

backend/src/dal/user.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -881,10 +881,12 @@ export async function recordAutoBanEvent(
881881
uid
882882
);
883883

884-
const discordIdIsValid =
885-
user.discordId !== undefined && user.discordId !== "";
886-
if (discordIdIsValid) {
887-
await GeorgeQueue.userBanned(user.discordId as string, true);
884+
if (banningUser) {
885+
const discordIdIsValid =
886+
user.discordId !== undefined && user.discordId !== "";
887+
if (discordIdIsValid) {
888+
await GeorgeQueue.userBanned(user.discordId as string, true);
889+
}
888890
}
889891

890892
return ret;

0 commit comments

Comments
 (0)