Skip to content

Commit

Permalink
error handling for eqstart
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCos17 committed Aug 8, 2024
1 parent 8068621 commit cd875b0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions earthquake/earthquake.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ async def stop_messages(self, ctx):

@commands.command(name='eqstart', help='Restart earthquake messages and tasks')
async def start_messages(self, ctx):
if self.check_earthquakes.is_running(): # Check if the task is already running
await ctx.send("Earthquake messages are already running.")
return
self.stop_messages = False # Reset the flag to allow messages
self.check_earthquakes.start() # Restart the task loop
await ctx.send("Earthquake messages and tasks have been restarted.")
Expand Down

0 comments on commit cd875b0

Please sign in to comment.