fix: dont award discord roles if user opted out of leaderboards

This commit is contained in:
Miodec 2025-01-31 19:42:17 +01:00
parent 1f771e3a09
commit 93a744b4ee

View file

@ -437,7 +437,12 @@ export async function addResult(
if (completedEvent.mode === "time" && completedEvent.mode2 === "60") {
void UserDAL.incrementBananas(uid, completedEvent.wpm);
if (isPb && user.discordId !== undefined && user.discordId !== "") {
if (
isPb &&
user.discordId !== undefined &&
user.discordId !== "" &&
user.lbOptOut !== true
) {
void GeorgeQueue.updateDiscordRole(user.discordId, completedEvent.wpm);
}
}