diff --git a/commands/space.py b/commands/space.py index 68d58ee..075eb9a 100644 --- a/commands/space.py +++ b/commands/space.py @@ -20,6 +20,11 @@ async def command_space(room: MatrixRoom, event: RoomMessageText, bot): bot.logger.log( f"Created space {space} for user {event.sender}") + if bot.logo_uri: + await bot.matrix_client.room_put_state(space, "m.room.avatar", { + "url": bot.logo_uri + }, "") + with bot.database.cursor() as cursor: cursor.execute( "INSERT INTO user_spaces (space_id, user_id) VALUES (?, ?)", (space, event.sender)) @@ -87,6 +92,11 @@ async def command_space(room: MatrixRoom, event: RoomMessageText, bot): await bot.add_rooms_to_space(space, join_rooms) + if bot.logo_uri: + await bot.matrix_client.room_put_state(space, "m.room.avatar", { + "url": bot.logo_uri + }, "") + await bot.send_message(room, "Space updated.", True) return