Improve MineGeo UI and application flows
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 2m37s
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 2m37s
This commit is contained in:
18
lib/tournament-discord-server.ts
Normal file
18
lib/tournament-discord-server.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import "server-only";
|
||||
import { after } from "next/server";
|
||||
import { admin } from "./supabase";
|
||||
import { discordConfiguration } from "./discord-client";
|
||||
import { dispatchTournamentAnnouncements } from "./tournament-discord";
|
||||
|
||||
export function tournamentDiscordAfterResponse(target?: string) {
|
||||
if (!discordConfiguration(process.env).token) return;
|
||||
after(async () => {
|
||||
try {
|
||||
await dispatchTournamentAnnouncements(admin(), process.env, target);
|
||||
} catch {
|
||||
console.error(
|
||||
"Tournament announcement delivery paused; saved announcements will retry.",
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user