fix: slight duplicate removal

This commit is contained in:
silver 2025-02-18 22:46:58 +00:00
parent 8c81fb864a
commit a8c1cc9cf1
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D
3 changed files with 22 additions and 26 deletions

View file

@ -91,6 +91,20 @@ Sign up on [UL Wolves]({}) and go to https://discord.com/channels/{}/{} and use
}
}
// handles role updates
async fn guild_member_update(&self, ctx: Context, _old_data: Option<Member>, new_data: Member) {
// get config/db
let db_lock = {
let data_read = ctx.data.read().await;
data_read.get::<DataBase>().expect("Expected Config in TypeMap.").clone()
};
let db = db_lock.read().await;
// check if the role changed is part of the oens for this server
on_role_change(&db, &ctx, new_data).await;
}
async fn ready(&self, ctx: Context, ready: Ready) {
println!("[Main] {} is connected!", ready.user.name);
ctx.set_presence(Some(Activity::playing("with humanity's fate")), OnlineStatus::Online).await;
@ -139,20 +153,6 @@ Sign up on [UL Wolves]({}) and go to https://discord.com/channels/{}/{} and use
}
}
}
// handles role updates
async fn guild_member_update(&self, ctx: Context, _old_data: Option<Member>, new_data: Member) {
// get config/db
let db_lock = {
let data_read = ctx.data.read().await;
data_read.get::<DataBase>().expect("Expected Config in TypeMap.").clone()
};
let db = db_lock.read().await;
// check if the role changed is part of the oens for this server
on_role_change(&db, &ctx, new_data).await;
}
}
async fn get_committee(db: &Pool<Sqlite>, committee: &str) -> Vec<Committees> {