From f2cd49662f74deb894518d5169fae533454bd6a6 Mon Sep 17 00:00:00 2001 From: Ashelyn Rose Date: Sat, 5 Oct 2024 20:05:36 -0600 Subject: System manager now knows user_id of each bot --- src/system/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/system/mod.rs') diff --git a/src/system/mod.rs b/src/system/mod.rs index bd27f4a..6c4d95f 100644 --- a/src/system/mod.rs +++ b/src/system/mod.rs @@ -84,7 +84,10 @@ impl Manager { loop { match system_receiver.recv().await { - Some(SystemEvent::GatewayConnected(member_id)) => { + Some(SystemEvent::GatewayConnected(member_id, user_id)) => { + self.config.members.iter_mut().enumerate() + .find(|(id, _)| *id == member_id).unwrap().1.user_id = Some(user_id); + let member = self.find_member_by_id(member_id).unwrap(); println!("Gateway client {} ({}) connected", member.name, member_id); -- cgit 1.4.1