feat: updated teh bot to use the new wolves_id for clubs/socs
This commit is contained in:
parent
9ce5b8136b
commit
6481fcb89f
5 changed files with 21 additions and 15 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue