oopsie
Some checks failed
Deploy Backend / docker (ubuntu-latest) (push) Successful in 54s
Deploy Website / docker (ubuntu-latest) (push) Has been cancelled

This commit is contained in:
Lee
2024-10-22 17:32:09 +01:00
parent f3dee6a7d2
commit 36ab7eb4cf
2 changed files with 14 additions and 17 deletions

View File

@ -23,7 +23,8 @@ import LeaderboardController from "./controller/leaderboard.controller";
import { getAppVersion } from "./common/app.util";
import { connectScoresaberWebsocket } from "@ssr/common/websocket/scoresaber-websocket";
import { connectBeatLeaderWebsocket } from "@ssr/common/websocket/beatleader-websocket";
import { initDiscordBot } from "./bot/bot";
import { DiscordChannels, initDiscordBot, logToChannel } from "./bot/bot";
import { EmbedBuilder } from "discord.js";
// Load .env file
dotenv.config({
@ -40,11 +41,23 @@ connectScoresaberWebsocket({
await ScoreService.trackScoreSaberScore(score);
await ScoreService.notifyNumberOne(score);
},
onDisconnect: async error => {
await logToChannel(
DiscordChannels.backendLogs,
new EmbedBuilder().setDescription(`ScoreSaber websocket disconnected: ${JSON.stringify(error)}`)
);
},
});
connectBeatLeaderWebsocket({
onScore: async score => {
await ScoreService.trackBeatLeaderScore(score);
},
onDisconnect: async error => {
await logToChannel(
DiscordChannels.backendLogs,
new EmbedBuilder().setDescription(`BeatLeader websocket disconnected: ${JSON.stringify(error)}`)
);
},
});
export const app = new Elysia();