Admin: Reiter Matches und Einstellungen, Discord-Embeds, CSTV-Zugang
Der Admin-Bereich bekommt Reiter. Die Discord-Einstellungen liegen unter „Einstellungen“. Meldungen sind als Embeds formatiert, und die Match-Startmeldung enthält den CSTV-Zugang (Passwort und Adresse).
This commit is contained in:
1 parent
301da179ed
commit
be474ee143
6 files changed
+79
-21
No files matched your search
@@ -81,7 +81,8 @@ export function createAdminRouter({ service, manager, config }) {
|
||||
router.put('/notifications', requireAdmin, wrap((req) => service.setNotificationEvents(req.body?.events)));
|
||||
router.post('/notifications/test', requireAdmin, wrap(async () => {
|
||||
if (!service.notifier.enabled) throw new HttpError(409, 'Kein Discord-Webhook eingerichtet (DISCORD_WEBHOOK_URL)', 'not_configured');
|
||||
if (!(await service.notifier.send('Testmeldung aus CS2 Mapveto'))) {
|
||||
const test = { embeds: [{ title: '🧪 Testmeldung', description: 'Die Verbindung zu CS2 Mapveto funktioniert.', color: 0x3b82f6 }] };
|
||||
if (!(await service.notifier.send(test))) {
|
||||
throw new HttpError(502, 'Discord hat die Meldung nicht angenommen (siehe Log)', 'send_failed');
|
||||
}
|
||||
return { ok: true };
|
||||
|
||||
Reference in new issue
Block a user