chore(config): centralize feature settings
This commit is contained in:
@@ -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`,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user