Changed join on invite logic and added debug print. Fixes #5 (hopefully).
This commit is contained in:
parent
f93069fc4b
commit
73084a15f9
6
bot.py
6
bot.py
|
@ -117,9 +117,7 @@ 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):
|
for attempt in range(3):
|
||||||
result = await self.client.join(room.room_id)
|
result = await self.client.join(room.room_id)
|
||||||
if type(result) == JoinError:
|
if type(result) == JoinError:
|
||||||
|
@ -128,6 +126,8 @@ class Bot:
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
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