From eadc4d7791cc3ad0f186cf54b8b5c2aed48ec7bf Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 9 Aug 2024 11:11:56 +0200 Subject: [PATCH] fix(bot): separate user_id from client creation Removed user_id from the AsyncClient constructor and set it separately on the client object. This change ensures that the user_id is consistently assigned regardless of the homeserver type, improving maintainability and clarity of client configuration. --- bot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index ead7fe2..1ab7b46 100644 --- a/bot.py +++ b/bot.py @@ -29,13 +29,15 @@ class RoombaBot: self.access_token = access_token if pantalaimon_homeserver and pantalaimon_token: - self.client = nio.AsyncClient(pantalaimon_homeserver, user_id) + self.client = nio.AsyncClient(pantalaimon_homeserver) self.client.access_token = pantalaimon_token else: - self.client = nio.AsyncClient(homeserver, user_id) + self.client = nio.AsyncClient(homeserver) self.client.access_token = access_token + self.client.user_id = user_id + self.moderation_room_id = moderation_room_id self.logger = logging.getLogger(__name__) self.logger.setLevel(logging.DEBUG)