diff options
author | Ashelyn Rose <git@ashen.earth> | 2024-10-05 20:05:36 -0600 |
---|---|---|
committer | Ashelyn Rose <git@ashen.earth> | 2024-10-05 20:05:36 -0600 |
commit | f2cd49662f74deb894518d5169fae533454bd6a6 (patch) | |
tree | 2eebd051d5fe3ec8d739e7ec9dfe8f2c0c102de1 /src/system/mod.rs | |
parent | ca4b0e32be531053f19ce2895b994130b247af4a (diff) |
System manager now knows user_id of each bot
Diffstat (limited to 'src/system/mod.rs')
-rw-r--r-- | src/system/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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); |