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 -5
View File
@@ -1,4 +1,5 @@
import "server-only";
import { getDiscordServerConfig } from "@/lib/config/server";
export type DiscordVoiceChannel = {
id: string;
@@ -52,11 +53,7 @@ export async function getCurrentDiscordVoiceChannels() {
return channelCache.data;
}
const token = process.env.DISCORD_BOT_TOKEN;
const guildId = process.env.DISCORD_GUILD_ID;
if (!token || !guildId) {
throw new Error("Discord channel access is not configured.");
}
const { token, guildId } = getDiscordServerConfig();
const response = await fetch(
`https://discord.com/api/v10/guilds/${guildId}/channels`,