chore(config): centralize feature settings

This commit is contained in:
2026-08-09 21:20:19 +07:00 Unverified
parent 26c0b5af18
commit 950d3d4afe
22 changed files with 238 additions and 70 deletions
+2 -4
View File
@@ -1,11 +1,9 @@
import "server-only";
import { getDiscordServerConfig } from "@/lib/config/server";
export async function getDiscordMemberCount(): Promise<number | null> {
const token = process.env.DISCORD_BOT_TOKEN;
const guildId = process.env.DISCORD_GUILD_ID;
if (!token || !guildId) return null;
try {
const { token, guildId } = getDiscordServerConfig();
const res = await fetch(
`https://discord.com/api/v10/guilds/${encodeURIComponent(guildId)}?with_counts=true`,
{