feat(utils): don't asks for grinders if rewards are disabled
Some checks failed
Build and Push Docker Image / build (push) Failing after 18s

This commit is contained in:
Pihkaal
2025-12-21 11:49:48 +01:00
parent d3561c019d
commit 1cbd752977

View File

@@ -12,6 +12,8 @@ export const askForGrinders = async (quest: QuestResult, client: Client) => {
return questLogger.fatal("Invalid 'DISCORD_ADMIN_CHANNEL'");
}
let exclude: string[] = [];
if (env.QUEST_REWARDS) {
const top10 = quest.participants
.filter((x) => !env.QUEST_EXCLUDE.includes(x.username))
.sort((a, b) => b.xp - a.xp)
@@ -99,10 +101,12 @@ export const askForGrinders = async (quest: QuestResult, client: Client) => {
return questLogger.fatal("Answer was 'null', this should be unreachable");
}
const exclude = answer
exclude = answer
.split(",")
.map((x) => x.trim())
.filter(Boolean);
}
const embed = await makeResultEmbed(quest, [
...env.QUEST_EXCLUDE,
...exclude,
@@ -116,6 +120,8 @@ export const askForGrinders = async (quest: QuestResult, client: Client) => {
return questLogger.fatal("Invalid 'DISCORD_REWARDS_CHANNEL'");
}
if (env.QUEST_EXCLUDE) {
await adminChannel.send("Envoyé !");
}
questLogger.info(`Results posted at: ${new Date().toISOString()}`);
};