mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-17 19:15:59 +08:00
storing list of auto assignable roles on the server
This commit is contained in:
parent
44d996fe6c
commit
03d90949df
2 changed files with 44 additions and 1 deletions
|
@ -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;
|
||||
|
|
38
backend/src/constants/auto-roles.ts
Normal file
38
backend/src/constants/auto-roles.ts
Normal 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",
|
||||
];
|
Loading…
Add table
Reference in a new issue