Skip to content

Commit

Permalink
handle KeyboardInterrupt
Browse files Browse the repository at this point in the history
  • Loading branch information
Z1xus committed Jul 26, 2023
1 parent 73b82a2 commit cd83fa5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,7 @@ async def on_ready():
try:
loop = asyncio.get_event_loop()
loop.run_until_complete(client.start(user_token))
except KeyboardInterrupt:
print("\nCtrl+C received, exiting...")
except Exception as e:
print(f"An error occurred while running the bot: {e}")

0 comments on commit cd83fa5

Please sign in to comment.