Skip to content

Commit

Permalink
Reference loop from bot object
Browse files Browse the repository at this point in the history
  • Loading branch information
scragly committed Apr 10, 2019
1 parent 32dce35 commit e97eb87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions eevee/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ def run_eevee(debug=False, launcher=None, from_restart=False):
eevee.logger.critical("Token and prefix must be set in order to login.")
sys.exit(1)
try:
loop.run_until_complete(eevee.start(eevee.token))
eevee.loop.run_until_complete(eevee.start(eevee.token))
except discord.LoginFailure:
eevee.logger.critical("Invalid token")
loop.run_until_complete(eevee.logout())
eevee.loop.run_until_complete(eevee.logout())
eevee.shutdown_mode = ExitCodes.SHUTDOWN
except KeyboardInterrupt:
eevee.logger.info("Keyboard interrupt detected. Quitting...")
loop.run_until_complete(eevee.logout())
eevee.loop.run_until_complete(eevee.logout())
eevee.shutdown_mode = ExitCodes.SHUTDOWN
except Exception as exc:
eevee.logger.critical("Fatal exception", exc_info=exc)
loop.run_until_complete(eevee.logout())
eevee.loop.run_until_complete(eevee.logout())
finally:
code = eevee.shutdown_mode
sys.exit(code.value)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
'colorthief',
'more_itertools',
'numpy',
'pendulum'
'pendulum',
'pytz'
],

dependency_links=[
Expand Down

0 comments on commit e97eb87

Please sign in to comment.