Skip to content

Commit cb646e0

Browse files
committed
chore: Add lb overload for BG
1 parent f197d1d commit cb646e0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/ps/commands/points.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { uploadToPastie } from 'ps-client/tools';
22

33
import { PSPointsNonce, PSRoomConfigs } from '@/cache';
4+
import { getAllUGOPoints } from '@/cache/ugo';
45
import {
56
type BulkPointsDataInput,
67
type Model as PointsModel,
@@ -11,6 +12,7 @@ import {
1112
resetPoints,
1213
} from '@/database/points';
1314
import { IS_ENABLED } from '@/enabled';
15+
import { renderUGOBoardGamesLeaderboard } from '@/ps/commands/games/other';
1416
import { LB_COMMON_STYLES as COMMON_STYLES, LB_STYLES } from '@/ps/other/leaderboardStyles';
1517
import { toId } from '@/tools';
1618
import { ChatError } from '@/utils/chatError';
@@ -242,6 +244,13 @@ export const command: PSCommand[] = [
242244
aliases: ['lb'],
243245
categories: ['points'],
244246
async run({ message, $T, args, broadcastHTML }) {
247+
// UGO-CODE
248+
if (message.target.roomid === 'boardgames') {
249+
// Overload for Board Games
250+
const data = getAllUGOPoints();
251+
message.author.pageHTML(renderUGOBoardGamesLeaderboard(data, $T), { name: 'ugo' });
252+
return;
253+
}
245254
if (!IS_ENABLED.DB) throw new ChatError($T('DISABLED.DB'));
246255
// TODO: Maybe have some helper function to parse room name if not given
247256
const room = message.parent.getRoom(message.type === 'chat' ? message.target.id : (args.shift() ?? ''));

0 commit comments

Comments
 (0)