From 947f31ad96583db717a48cfe8924b58cd6f59d74 Mon Sep 17 00:00:00 2001 From: lemoer Date: Sat, 21 Dec 2024 05:40:20 +0100 Subject: [PATCH] main: do not create bot as user in sync_members_as_active_users() --- main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index a98326e..cf404ce 100644 --- a/main.py +++ b/main.py @@ -191,11 +191,12 @@ class LabCleaningBot: return Ok(other_members) def sync_members_as_active_users(self, session) -> Result[None, str]: - group = self.api.get_group(self.base_group) - if group.is_err(): - return Err(group.unwrap_err()) + maybe_members = self.get_other_members() - members = group.unwrap().members + if is_err(maybe_members): + return Err(maybe_members.unwrap_err()) + + members = maybe_members.unwrap() for member in members: maybe_user = get_user_by_name(session, member, only_active=False)