Skip to content

Commit

Permalink
Add handling to allow running on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
flaree committed Sep 12, 2024
1 parent 081280c commit d56a007
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ballsdex/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,12 @@ def main():

exc_handler = functools.partial(global_exception_handler, bot)
loop.set_exception_handler(exc_handler)
loop.add_signal_handler(
SIGTERM, lambda: loop.create_task(shutdown_handler(bot, "SIGTERM"))
)
try:
loop.add_signal_handler(
SIGTERM, lambda: loop.create_task(shutdown_handler(bot, "SIGTERM"))
)
except NotImplementedError:
log.warning("Cannot add signal handler for SIGTERM.")

log.info("Initialized bot, connecting to Discord...")
future = loop.create_task(bot.start(token))
Expand Down

0 comments on commit d56a007

Please sign in to comment.