storing list of auto assignable roles on the server

This commit is contained in:
Miodec 2022-06-16 18:29:15 +02:00
parent 44d996fe6c
commit 03d90949df
2 changed files with 44 additions and 1 deletions

View file

@ -27,6 +27,7 @@ import {
} from "../../utils/prometheus";
import * as George from "../../tasks/george";
import { getDailyLeaderboard } from "../../utils/daily-leaderboards";
import AutoRoleList from "../../constants/auto-roles";
try {
if (anticheatImplemented() === false) throw new Error("undefined");
@ -292,7 +293,11 @@ export async function addResult(
}
}
if (result.challenge && user.discordId) {
if (
result.challenge &&
AutoRoleList.includes(result.challenge) &&
user.discordId
) {
George.awardChallenge(user.discordId, result.challenge);
} else {
delete result.challenge;

View file

@ -0,0 +1,38 @@
export default [
"oneHourWarrior",
"doubleDown",
"tripleTrouble",
"quad",
"trueSimp",
"bigramSalad",
"simp",
"antidiseWhat",
"whatsThisWebsiteCalledAgain",
"developd",
"slowAndSteady",
"speedSpacer",
"iveGotThePower",
"accuracyExpert",
"accuracyMaster",
"accuracyGod",
"jolly",
"gottaCatchEmAll",
"rapGod",
"navySeal",
"rollercoaster",
"oneHourMirror",
"chooChoo",
"earfquake",
"simonSez",
"accountant",
"hidden",
"iCanSeeTheFuture",
"whatAreWordsAtThisPoint",
"specials",
"aeiou",
"asciiWarrior",
"iKiNdAlIkEhOwInEfFiCiEnTqWeRtYiS",
"oneNauseousMonkey",
"69",
"englishMaster",
];