Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 2m37s
19 lines
596 B
TypeScript
19 lines
596 B
TypeScript
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.",
|
|
);
|
|
}
|
|
});
|
|
}
|