Changed join on invite logic and added debug print. Fixes #5 (hopefully).
This commit is contained in:
parent
f93069fc4b
commit
73084a15f9
22
bot.py
22
bot.py
|
@ -117,17 +117,17 @@ class Bot:
|
||||||
traceback.print_exc(file=sys.stderr)
|
traceback.print_exc(file=sys.stderr)
|
||||||
|
|
||||||
async def invite_cb(self, room, event):
|
async def invite_cb(self, room, event):
|
||||||
if not self.join_on_invite or self.is_owner(event):
|
if self.join_on_invite or self.is_owner(event):
|
||||||
return
|
for attempt in range(3):
|
||||||
|
result = await self.client.join(room.room_id)
|
||||||
for attempt in range(3):
|
if type(result) == JoinError:
|
||||||
result = await self.client.join(room.room_id)
|
print(f"Error joining room {room.room_id} (attempt %d): %s",
|
||||||
if type(result) == JoinError:
|
attempt, result.message,
|
||||||
print(f"Error joining room {room.room_id} (attempt %d): %s",
|
)
|
||||||
attempt, result.message,
|
else:
|
||||||
)
|
break
|
||||||
else:
|
else:
|
||||||
break
|
print('Received invite event, but not joining as sender is not owner or bot not configured to join on invte.')
|
||||||
|
|
||||||
def load_module(self, modulename):
|
def load_module(self, modulename):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue