From 00d0bfced902e97eeae5257c14134d4bc7efc710 Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Thu, 18 Jan 2024 10:58:36 -0600 Subject: Commands to interact with discocaml, associated IPC. --- src/handlers/x500_mapper.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/handlers/x500_mapper.rs') diff --git a/src/handlers/x500_mapper.rs b/src/handlers/x500_mapper.rs index 1ec35f2..acd498f 100644 --- a/src/handlers/x500_mapper.rs +++ b/src/handlers/x500_mapper.rs @@ -90,9 +90,9 @@ impl X500Mapper { async fn record_x500(&self, ctx: &Context, member: Member, x500: String) { let x500 = &x500; - let uid = member.user.id; + let member = &member; let future = async move { - let uid = i64::from(uid); + let uid = i64::from(member.user.id); sqlx::query!( "INSERT OR IGNORE INTO all_seen_uids_to_x500s (uid, x500) VALUES (?, ?)", uid, @@ -112,8 +112,8 @@ impl X500Mapper { .context("failed to insert into uids_to_x500s_clean")?; if let Some(role) = self.config.students_role { - log::info!("adding the role {} to {}", role, member.display_name()); if !member.roles.contains(&role) { + log::info!("adding the role {} to {:?}", role, member.display_name()); member .add_role(&ctx.http, role) .await @@ -127,8 +127,9 @@ impl X500Mapper { match future.await { Ok(()) => (), Err(err) => log::error!( - "failed to record that the user with UID {} had the X.500 {}: {:?}", - uid, + "failed to record that the user with UID {} ({:?}) had the X.500 {}: {:?}", + member.user.id, + member.display_name(), x500, err ), -- cgit v1.2.3