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