feat: use values from teh env file to dictate the servers
All checks were successful
/ check_lfs (pull_request) Successful in 8s
/ check_lfs (push) Successful in 8s

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

View file

@ -282,7 +282,7 @@ pub mod link {
pub mod verify {
use super::*;
use crate::commands::wolves::link::{db_pending_clear_expired, get_server_member_discord, get_verify_from_db};
use serenity::all::{CommandDataOption, CommandDataOptionValue, CommandInteraction, GuildId, RoleId};
use serenity::all::{CommandDataOption, CommandDataOptionValue, CommandInteraction};
use serenity::model::user::User;
use skynet_discord_bot::common::database::get_server_config;
use skynet_discord_bot::common::database::{ServerMembersWolves, Servers};
@ -429,12 +429,18 @@ pub mod verify {
}
async fn set_server_roles_committee(db: &Pool<Sqlite>, discord: &User, ctx: &Context) {
let config_lock = {
let data_read = ctx.data.read().await;
data_read.get::<Config>().expect("Expected Config in TypeMap.").clone()
};
let config = config_lock.read().await;
if let Some(x) = get_server_member_discord(db, &discord.id).await {
// if they are a member of one or more committees, and in teh committee server then give the teh general committee role
// they will get teh more specific vanity role later
if !get_committees_id(db, x.id_wolves).await.is_empty() {
let server = GuildId::new(1220150752656363520);
let committee_member = RoleId::new(1226602779968274573);
let server = config.committee_server;
let committee_member = config.committee_role;
if let Ok(member) = server.member(ctx, &discord.id).await {
member.add_roles(&ctx, &[committee_member]).await.unwrap_or_default();