feat: use values from teh env file to dictate the servers

This commit is contained in:
silver 2025-06-16 21:50:26 +01:00
parent 72226cc59b
commit a6eff75e39
Signed by untrusted user: silver
GPG key ID: 36F93D61BAD3FD7D
5 changed files with 33 additions and 29 deletions

View file

@ -32,7 +32,7 @@ pub struct Config {
// discord server for committee
pub committee_server: GuildId,
pub committee_role: RoleId,
pub committee_category: ChannelId,
pub committee_category: Vec<ChannelId>,
// items pertaining to compsoc only
pub compsoc_server: GuildId,
@ -60,7 +60,7 @@ pub fn get_config() -> Config {
wolves_api: "".to_string(),
committee_server: GuildId::new(1),
committee_role: RoleId::new(1),
committee_category: ChannelId::new(1),
committee_category: vec![],
compsoc_server: GuildId::new(1),
};
@ -109,8 +109,10 @@ pub fn get_config() -> Config {
}
}
if let Ok(x) = env::var("COMMITTEE_CATEGORY") {
if let Ok(x) = x.trim().parse::<u64>() {
config.committee_category = ChannelId::new(x);
for part in x.split(",") {
if let Ok(x) = part.trim().parse::<u64>() {
config.committee_category.push(ChannelId::new(x));
}
}
}