Skip to content

Commit 2ec02db

Browse files
committed
Remove unnecessary index.ts
1 parent b58ab8e commit 2ec02db

File tree

4 files changed

+7
-30
lines changed

4 files changed

+7
-30
lines changed

src/bots/webhook.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { getFullUser } from "../utils/user";
1313
import { IntraWebhook } from "../utils/types";
1414
import Logger, { LogType } from "../utils/logger";
1515
import { Request, Response, NextFunction } from "express";
16-
import * as Checks from "../checks/index";
16+
import * as Checks from "../checks/evaluators";
1717

1818
/*============================================================================*/
1919

@@ -108,7 +108,7 @@ export namespace Webhook {
108108

109109
// NOTE (W2): Completely fucked up and weird endpoint btw.
110110
const teamUsers = await Intra.getTeamUsers(hook.team.id);
111-
return (await Checks.Evaluators(hook, evaluations, teamUsers)) || (await Checks.Random());
111+
return (await Checks.evaluators(hook, evaluations, teamUsers)) || Checks.random();
112112
}
113113

114114
/**

src/checks/evaluators.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { getFullUser, User } from "../utils/user";
2121
* @param evaluations The evaluations of the project.
2222
* @return True if an evaluation is required, else false.
2323
*/
24-
export async function Evaluators(hook: IntraWebhook.Root, evaluations: Intra.ScaleTeam[], teamUsers: IntraResponse.TeamUser[]) {
24+
export async function evaluators(hook: IntraWebhook.Root, evaluations: Intra.ScaleTeam[], teamUsers: IntraResponse.TeamUser[]) {
2525
const leaderData = teamUsers.find((value) => value.leader == true)!;
2626

2727
let levels: number[] = [];
@@ -49,3 +49,7 @@ export async function Evaluators(hook: IntraWebhook.Root, evaluations: Intra.Sca
4949
}
5050
return true;
5151
}
52+
53+
export function random() {
54+
return Math.random() < Config.randomEvalChance / 100;
55+
}

src/checks/index.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/checks/random.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)