Ensure that we only write a message on join when the room was joined

This commit is contained in:
MTRNord 2023-02-01 10:35:44 +01:00
parent b53a7c88f6
commit 88532ef2bb
No known key found for this signature in database
1 changed files with 4 additions and 0 deletions

View File

@ -203,6 +203,10 @@ class RecordingBot:
response = f"Hello, I am a bot that records calls. Use !help to see available commands. I was invited by {sender_display_name.displayname}"
else:
response = f"Hello, I am a bot that records calls. Use !help to see available commands. I was invited by {event.sender}"
# FIXME: We should also check if the join worked or not.
while room.room_id not in self.client.rooms:
logger.debug("Waiting for room to be joined")
await asyncio.sleep(0.2)
await self.client.room_send(
room.room_id,
"m.room.message",