feat: updated teh bot to use the new wolves_id for clubs/socs
All checks were successful
On_Push / lint_fmt (push) Successful in 16s
On_Push / lint_clippy (push) Successful in 3m48s
On_Push / build (push) Successful in 2m56s
On_Push / deploy (push) Successful in 15s

This commit is contained in:
silver 2025-02-24 17:07:26 +00:00
parent 9ce5b8136b
commit 6481fcb89f
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D
5 changed files with 21 additions and 15 deletions

View file

@ -68,7 +68,7 @@ impl EventHandler for Handler {
println!("{:?}", e);
}
} else {
let tmp = get_committee(&db, &config_server.server_name).await;
let tmp = get_committee(&db, config_server.wolves_id).await;
if !tmp.is_empty() {
let committee = &tmp[0];
let msg = format!(
@ -158,15 +158,15 @@ Sign up on [UL Wolves]({}) and go to https://discord.com/channels/{}/{} and use
}
}
async fn get_committee(db: &Pool<Sqlite>, committee: &str) -> Vec<Committees> {
async fn get_committee(db: &Pool<Sqlite>, wolves_id: i64) -> Vec<Committees> {
sqlx::query_as::<_, Committees>(
r#"
SELECT *
FROM committees
WHERE name_plain = ?
WHERE id = ?
"#,
)
.bind(committee)
.bind(wolves_id)
.fetch_all(db)
.await
.unwrap_or_default()