Discord-Webhook für Streamer-Meldungen mit wählbaren Ereignissen
Meldungen zu Veto, Match-Start, Map- und Serienende, Matchende und Serverfehlern gehen an DISCORD_WEBHOOK_URL. Im Admin-Bereich wählt man, welche Ereignisse gemeldet werden, und kann eine Testmeldung senden.
This commit is contained in:
1 parent
eee4ceb315
commit
7bceceb31d
12 files changed
+254
-2
No files matched your search
+3
-1
@@ -5,6 +5,7 @@ import express from 'express';
|
||||
import { REPO_ROOT } from './config.js';
|
||||
import { openDatabase } from './db.js';
|
||||
import { createApiRouter } from './http.js';
|
||||
import { createDiscordNotifier } from './discord.js';
|
||||
import { loadMapPools } from './mapPools.js';
|
||||
import { MatchService } from './matchService.js';
|
||||
import { attachRealtime } from './realtime.js';
|
||||
@@ -15,7 +16,8 @@ import { ServerManager } from './servers/serverManager.js';
|
||||
export function createApp(config, { adapter: adapterOverride, logger = console } = {}) {
|
||||
const db = openDatabase(config.databaseFile);
|
||||
const pools = loadMapPools(config.mapPoolFile);
|
||||
const service = new MatchService({ db, pools, config });
|
||||
const notifier = createDiscordNotifier(config.discordWebhookUrl, { logger });
|
||||
const service = new MatchService({ db, pools, config, notifier });
|
||||
|
||||
let manager;
|
||||
const adapter = adapterOverride ?? createServerAdapter(config, { getUsedPorts: () => manager.usedPorts() });
|
||||
|
||||
Reference in new issue
Block a user