fix: correct target room for avatar setup

Fixed an issue where the bot attempted to set the avatar for the wrong room when creating a new room. The avatar is now correctly assigned to the newly created room instead of the incorrectly referenced room variable. This ensures that newly created rooms properly display the intended logo from the start, improving the user experience by maintaining consistent branding across rooms.
This commit is contained in:
Kumi 2024-05-18 21:30:48 +02:00
parent 141e89ab11
commit 27df072c0d
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -47,7 +47,7 @@ class Newroom(BaseTool):
await self.bot.add_rooms_to_space(space[0], [new_room.room_id]) await self.bot.add_rooms_to_space(space[0], [new_room.room_id])
if self.bot.logo_uri: if self.bot.logo_uri:
await self.bot.matrix_client.room_put_state(room, "m.room.avatar", { await self.bot.matrix_client.room_put_state(new_room, "m.room.avatar", {
"url": self.bot.logo_uri "url": self.bot.logo_uri
}, "") }, "")