fp/services/bot/src/config.ts

38 lines
1.4 KiB
TypeScript
Raw Normal View History

2024-08-07 23:43:17 +00:00
if (!process.env.WORKER_CONNECTION_STRING) throw new Error("WORKER_CONNECTION_STRING was missing from env");
2024-08-07 01:13:58 +00:00
if (!process.env.POSTGREST_URL) throw new Error('Missing POSTGREST_URL env var');
if (!process.env.DISCORD_TOKEN) throw new Error('Missing DISCORD_TOKEN env var');
2024-08-07 23:43:17 +00:00
if (!process.env.DISCORD_CHANNEL_ID) throw new Error("DISCORD_CHANNEL_ID was missing from env");
if (!process.env.DISCORD_GUILD_ID) throw new Error("DISCORD_GUILD_ID was missing from env");
2024-08-17 02:42:44 +00:00
if (!process.env.DISCORD_APPLICATION_ID) throw new Error('DISCORD_APPLICATION_ID was missing from env');
2024-08-07 01:13:58 +00:00
if (!process.env.AUTOMATION_USER_JWT) throw new Error('Missing AUTOMATION_USER_JWT env var');
const token = process.env.DISCORD_TOKEN!
const postgrestUrl = process.env.POSTGREST_URL!
2024-08-07 23:43:17 +00:00
const discordChannelId = process.env.DISCORD_CHANNEL_ID!
const discordGuildId = process.env.DISCORD_GUILD_ID!
2024-08-07 01:13:58 +00:00
const automationUserJwt = process.env.AUTOMATION_USER_JWT!
2024-08-07 23:43:17 +00:00
const connectionString = process.env.WORKER_CONNECTION_STRING!
2024-08-17 02:42:44 +00:00
const discordApplicationId = process.env.DISCORD_APPLICATION_ID!
2024-08-07 23:43:17 +00:00
2024-08-07 01:13:58 +00:00
export interface Config {
token: string;
postgrestUrl: string;
automationUserJwt: string;
2024-08-07 23:43:17 +00:00
discordGuildId: string;
discordChannelId: string;
connectionString: string;
2024-08-17 02:42:44 +00:00
discordApplicationId: string;
2024-08-07 01:13:58 +00:00
}
2024-08-07 23:43:17 +00:00
export const configs: Config = {
token,
postgrestUrl,
automationUserJwt,
discordGuildId,
discordChannelId,
connectionString,
2024-08-17 02:42:44 +00:00
discordApplicationId,
2024-08-07 23:43:17 +00:00
}