Skip to content

Commit

Permalink
added removing an app from the apps list
Browse files Browse the repository at this point in the history
  • Loading branch information
kanewi11 committed Nov 24, 2022
1 parent 087f7f1 commit 92cc0a2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions reactionbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,24 @@ async def main():
await app.start()
except OperationalError:
await try_convert(session_file_path, config_dict)
apps.remove((app, config_dict, session_file_path))
continue
except UserDeactivatedBan:
await move_session_to_ban_dir(session_file_path)
logging.warning('Session banned - ' + app.name)
apps.remove((app, config_dict, session_file_path))
continue
except Exception:
apps.remove((app, config_dict, session_file_path))
logging.warning(traceback.format_exc())
continue

for channel in CHANNELS:
await app.join_chat(channel)

if not apps:
raise Exception('No apps!')

await idle()

for app, _, _ in apps:
Expand Down

0 comments on commit 92cc0a2

Please sign in to comment.