Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 3m40s
22 lines
667 B
TypeScript
22 lines
667 B
TypeScript
import "server-only";
|
|
import { readChangelogFeed } from "./changelog-feed";
|
|
|
|
export async function getChangelog(before?: string) {
|
|
const token = process.env.DISCORD_BOT_TOKEN?.trim();
|
|
if (!token) return { entries: [], unavailable: true };
|
|
try {
|
|
return {
|
|
...(await readChangelogFeed({
|
|
token,
|
|
before,
|
|
channel: process.env.DISCORD_NEWS_CHANNEL_ID?.trim() || undefined,
|
|
webhookId: process.env.DISCORD_RELEASE_WEBHOOK_ID?.trim() || undefined,
|
|
})),
|
|
unavailable: false,
|
|
};
|
|
} catch {
|
|
// Do not expose Discord details or credentials to the public page.
|
|
return { entries: [], unavailable: true };
|
|
}
|
|
}
|