diff --git a/server/configuration.ts b/server/configuration.ts index 6c10ff7..fa3d020 100644 --- a/server/configuration.ts +++ b/server/configuration.ts @@ -20,6 +20,8 @@ export interface Config { jellyfin_url: string port: number workaround_token: string + watcher_role: string + jf_admin_role: string } } export const config: Config = { @@ -49,6 +51,8 @@ export const config: Config = { client_id: process.env.CLIENT_ID ?? "", jellfin_token: process.env.JELLYFIN_TOKEN ?? "", jellyfin_url: process.env.JELLYFIN_URL ?? "", - workaround_token: process.env.TOKEN ?? "" + workaround_token: process.env.TOKEN ?? "", + watcher_role: process.env.WATCHER_ROLE ?? "", + jf_admin_role: process.env.ADMIN_ROLE ?? "" } } diff --git a/server/helper/roleFilter.ts b/server/helper/roleFilter.ts index 7d64efe..f36f577 100644 --- a/server/helper/roleFilter.ts +++ b/server/helper/roleFilter.ts @@ -1,6 +1,7 @@ import { Collection, GuildMember } from "discord.js" import { ChangedRoles, PermissionLevel } from "../interfaces" import { logger } from "../logger" +import { config } from "../configuration" export function filterRolesFromMemberUpdate(oldMember: GuildMember, newMember: GuildMember): ChangedRoles { @@ -17,7 +18,7 @@ export function filterRolesFromMemberUpdate(oldMember: GuildMember, newMember: G export function getGuildSpecificTriggerRoleId(guildId: string): Collection { const outVal = new Collection() - outVal.set('1096819983889215659', "VIEWER") - outVal.set('1097990848613986526', "ADMIN") + outVal.set(config.bot.watcher_role, "VIEWER") + outVal.set(config.bot.jf_admin_role, "ADMIN") return outVal -} \ No newline at end of file +}