feat: added ratings leaderboard generation and publication

This commit is contained in:
TresAbhi committed 2023-07-14 01:32:20 +00:00
1 parent 098e6c09b9
commit 6d9e6973d5
35 files changed
+412 -84

No files matched your search

+3 -3
View File
@@ -1,5 +1,5 @@
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
import { BlitzServer } from '../../constants/servers';
import { RegionDomain } from '../../constants/regions';
import listPlayers, {
usernamePatternWithoutPosition,
} from '../blitz/listPlayers';
@@ -8,7 +8,7 @@ import throwError from '../node/throwError';
export const serverAndIdPattern = /(com|eu|asia)\/[0-9]+/;
export interface ResolvedPlayer {
server: BlitzServer;
server: RegionDomain;
id: number;
}
@@ -31,7 +31,7 @@ export default async function resolvePlayerFromCommand(
if (serverAndIdPattern.test(username)) {
const [server, accountId] = username.split('/');
return {
server: server as BlitzServer,
server: server as RegionDomain,
id: Number(accountId),
} satisfies ResolvedPlayer;
} else {