From 32249364ff4250c7d528f1bf7131566f06a015f2 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Mon, 28 Oct 2024 21:40:48 +0000 Subject: [PATCH] feat: new committee member joins the committee server they automagically get roles --- src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.rs b/src/main.rs index 6f86f86..a274a8b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,8 +15,10 @@ use serenity::{ }; use skynet_discord_bot::{get_config, Config}; use std::sync::Arc; +use serenity::model::id::GuildId; use tokio::sync::RwLock; use skynet_discord_bot::common::database::{db_init, get_server_config, get_server_member, DataBase}; +use skynet_discord_bot::common::set_roles::committee::update_committees; struct Handler; @@ -35,6 +37,13 @@ impl EventHandler for Handler { Some(x) => x, }; + // committee server takes priority + if new_member.guild_id.eq(&GuildId(1220150752656363520)) { + let mut member = vec![new_member.clone()]; + update_committees(&db, &ctx, &mut member).await; + return; + } + if get_server_member(&db, &new_member.guild_id, &new_member).await.is_ok() { let mut roles = vec![];