Skip to content

Commit 381b4ef

Browse files
committed
sentinel: Hotpatch Showdown
1 parent 70b9b02 commit 381b4ef

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/ps/handlers/tours.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { getChannel } from '@/discord/loaders/channels';
88
import { IS_ENABLED } from '@/enabled';
99
import { TimeZone } from '@/ps/handlers/cron/constants';
1010
import getSecretFunction from '@/secrets/functions';
11+
import { toId } from '@/tools';
1112
import { Form } from '@/utils/components/ps';
1213
import { errorLog } from '@/utils/logger';
1314
import { randomString } from '@/utils/random';
@@ -124,7 +125,10 @@ export function tourHandler(this: Client, roomId: string, line: string, isIntro?
124125
if (!pointsType) throw new Error(`AAAAAA someone ping PartMan for ${roomId}`);
125126
bulkAddPoints(
126127
Object.fromEntries(
127-
Object.entries(pointsToAdd).map(([user, points]) => [user, { id: user, points: { [pointsType]: points } }])
128+
Object.entries(pointsToAdd).map(([user, points]) => [
129+
user,
130+
{ id: toId(user), name: user, points: { [pointsType]: points } },
131+
])
128132
),
129133
roomId
130134
).then(() => {

src/sentinel/hotpatch.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import path from 'path';
33
import { update as updatePSData } from 'ps-client/tools';
44

55
import { PSRoomConfigs } from '@/cache';
6+
import { updateShowdownData } from '@/cache/showdown';
67
import { fetchRoomConfigs } from '@/database/psrooms';
78
import PS from '@/ps';
89
import { registers } from '@/sentinel/registers';
@@ -28,6 +29,11 @@ export async function hotpatch(this: Sentinel, hotpatchType: HotpatchType, by: s
2829
break;
2930
}
3031

32+
case 'showdown': {
33+
await updateShowdownData();
34+
break;
35+
}
36+
3137
case 'data': {
3238
await updatePSData();
3339
// TODO: cachebust

0 commit comments

Comments
 (0)