Set logo on space creation
This commit is contained in:
parent
cfeaae3fac
commit
9f520b7340
1 changed files with 10 additions and 0 deletions
|
@ -20,6 +20,11 @@ async def command_space(room: MatrixRoom, event: RoomMessageText, bot):
|
||||||
bot.logger.log(
|
bot.logger.log(
|
||||||
f"Created space {space} for user {event.sender}")
|
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:
|
with bot.database.cursor() as cursor:
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"INSERT INTO user_spaces (space_id, user_id) VALUES (?, ?)", (space, event.sender))
|
"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)
|
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)
|
await bot.send_message(room, "Space updated.", True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue