jellyfin-discord-bot/server/configuration.ts

77 lines
2.0 KiB
TypeScript
Raw Normal View History

2023-04-15 22:06:35 +02:00
import dotenv from "dotenv"
dotenv.config()
2023-04-16 02:02:15 +02:00
interface options {
2023-06-24 21:05:43 +02:00
[k: string]: boolean | number | string | undefined
2023-04-16 02:02:15 +02:00
}
interface bodyParserOptions {
2023-06-24 21:05:43 +02:00
urlEncodedOptions: options,
jsonOptions: options
2023-04-16 02:02:15 +02:00
}
export interface Config {
2023-06-24 21:05:43 +02:00
server: { bodyParser: bodyParserOptions },
bot: {
debug: boolean
silent: boolean
token: string
guild_id: string
client_id: string
jellfin_token: string
jellyfin_url: string
port: number
workaround_token: string
watcher_role: string
jf_admin_role: string
announcement_role: string
announcement_channel_id: string
jf_collection_id: string
jf_user: string
yavin_collection_id: string
yavin_jellyfin_url: string
yavin_jellyfin_token: string
yavin_jellyfin_collection_user: string
2023-07-05 23:22:25 +02:00
random_movie_count: number
2023-06-24 21:05:43 +02:00
}
2023-04-16 02:02:15 +02:00
}
export const config: Config = {
2023-06-24 21:05:43 +02:00
server: {
bodyParser: {
urlEncodedOptions: {
inflate: true,
limit: '5mb',
type: 'application/x-www-form-urlencoded',
extended: true,
parameterLimit: 1000
},
jsonOptions: {
inflate: true,
limit: '5mb',
type: 'application/json',
strict: true
}
}
},
bot: {
debug: true,
silent: false,
port: 1234,
token: process.env.BOT_TOKEN ?? "",
guild_id: process.env.GUILD_ID ?? "",
client_id: process.env.CLIENT_ID ?? "",
jellfin_token: process.env.JELLYFIN_TOKEN ?? "",
jellyfin_url: process.env.JELLYFIN_URL ?? "",
workaround_token: process.env.TOKEN ?? "",
watcher_role: process.env.WATCHER_ROLE ?? "",
jf_admin_role: process.env.ADMIN_ROLE ?? "",
announcement_role: process.env.WATCHPARTY_ANNOUNCEMENT_ROLE ?? "",
announcement_channel_id: process.env.CHANNEL_ID ?? "",
jf_collection_id: process.env.JELLYFIN_COLLECTION_ID ?? "",
yavin_collection_id: process.env.YAVIN_COLLECTION_ID ?? "",
yavin_jellyfin_url: process.env.YAVIN_JELLYFIN_URL ?? "",
yavin_jellyfin_token: process.env.YAVIN_TOKEN ?? "",
yavin_jellyfin_collection_user: process.env.YAVIN_COLLECTION_USER ?? "",
2023-07-05 23:22:25 +02:00
jf_user: process.env.JELLYFIN_USER ?? "",
2023-08-13 18:14:16 +02:00
random_movie_count: parseInt(process.env.RANDOM_MOVIE_COUNT ?? "5") ?? 5
2023-06-24 21:05:43 +02:00
}
2023-04-15 22:06:35 +02:00
}