fix: no need to have this being passed in here

This commit is contained in:
silver 2023-09-17 18:09:02 +01:00
parent a444d6a5e5
commit fa6920e4a3

View file

@ -137,13 +137,12 @@ async fn get_skynet(db: &Pool<Sqlite>, config: &Config) {
let url = format!("{}/ldap/discord?auth={}", &config.ldap_api, &config.auth);
if let Ok(result) = surf::get(url).recv_json::<Vec<SkynetResult>>().await {
for user in result {
add_users_skynet(db, &config.skynet_server, &user).await;
add_users_skynet(db, &user).await;
}
}
}
// TODO: Tidy up
async fn add_users_skynet(db: &Pool<Sqlite>, server: &GuildId, user: &SkynetResult) {
async fn add_users_skynet(db: &Pool<Sqlite>, user: &SkynetResult) {
match sqlx::query_as::<_, Wolves>(
"
UPDATE wolves
@ -158,7 +157,7 @@ async fn add_users_skynet(db: &Pool<Sqlite>, server: &GuildId, user: &SkynetResu
{
Ok(_) => {}
Err(e) => {
println!("Failure to insert into {} {:?}", server.as_u64(), user);
println!("Failure to insert skynet user into database {:?}", user);
println!("{:?}", e);
}
}
@ -206,7 +205,7 @@ async fn add_users_wolves(db: &Pool<Sqlite>, server: &GuildId, user: &WolvesResu
{
Ok(_) => {}
Err(e) => {
println!("Failure to insert into Wolves {} {:?}", server.as_u64(), user);
println!("Failure to insert into Wolves {:?}", user);
println!("{:?}", e);
}
}