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.
This commit is contained in:
parent
e0f3408b5c
commit
eadc4d7791
1 changed files with 4 additions and 2 deletions
6
bot.py
6
bot.py
|
@ -29,13 +29,15 @@ class RoombaBot:
|
||||||
self.access_token = access_token
|
self.access_token = access_token
|
||||||
|
|
||||||
if pantalaimon_homeserver and pantalaimon_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
|
self.client.access_token = pantalaimon_token
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.client = nio.AsyncClient(homeserver, user_id)
|
self.client = nio.AsyncClient(homeserver)
|
||||||
self.client.access_token = access_token
|
self.client.access_token = access_token
|
||||||
|
|
||||||
|
self.client.user_id = user_id
|
||||||
|
|
||||||
self.moderation_room_id = moderation_room_id
|
self.moderation_room_id = moderation_room_id
|
||||||
self.logger = logging.getLogger(__name__)
|
self.logger = logging.getLogger(__name__)
|
||||||
self.logger.setLevel(logging.DEBUG)
|
self.logger.setLevel(logging.DEBUG)
|
||||||
|
|
Loading…
Reference in a new issue