diff --git a/src/lib.rs b/src/lib.rs index 5a9d43d..144b5e1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ use chrono::{Datelike, SecondsFormat, Utc}; use dotenvy::dotenv; use rand::{distributions::Alphanumeric, thread_rng, Rng}; use serenity::client::Context; -use serenity::model::id::{GuildId, RoleId}; +use serenity::model::id::{ChannelId, GuildId, RoleId}; use serenity::model::prelude::application_command::ApplicationCommandInteraction; use serenity::prelude::TypeMapKey; use std::{env, sync::Arc}; @@ -31,6 +31,7 @@ pub struct Config { // discord server for committee pub committee_server: GuildId, pub committee_role: RoleId, + pub committee_category: ChannelId, } impl TypeMapKey for Config { type Value = Arc>; @@ -54,6 +55,7 @@ pub fn get_config() -> Config { wolves_api: "".to_string(), committee_server: GuildId(0), committee_role: RoleId(0), + committee_category: ChannelId(0), }; if let Ok(x) = env::var("DATABASE_HOME") { @@ -98,6 +100,11 @@ pub fn get_config() -> Config { config.committee_role = RoleId(x); } } + if let Ok(x) = env::var("COMMITTEE_CATEGORY") { + if let Ok(x) = x.trim().parse::() { + config.committee_category = ChannelId(x); + } + } config }