Skip to content

Commit

Permalink
test commands
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCos17 committed Aug 8, 2024
1 parent 9f0bd11 commit 53ca177
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion earthquake/earthquake.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,29 @@ async def earthquake(self, ctx, *, search_query: str = None):
@commands.command(name='eqstop', help='Stop the earthquake messages')
async def stop_messages(self, ctx):
self.stop_messages = True
await ctx.send("Earthquake messages stopped.")
await ctx.send("Earthquake messages stopped.")

@commands.command(name='testalert', help='Test the earthquake alert system')
async def test_alert(self, ctx):
if self.alert_channel_id is None:
await ctx.send("Alert channel is not set. Use `!setalertchannel` to set it.")
return
test_feature = {
'properties': {
'place': 'Test Location',
'mag': 5.0,
'time': datetime.datetime.now().timestamp() * 1000,
'url': 'https://earthquake.usgs.gov/'
},
'geometry': {
'coordinates': [0, 0, 10]
}
}
await self.send_earthquake_embed(ctx, test_feature)

@commands.command(name='forceupdate', help='Force an update for earthquake alerts')
async def force_update(self, ctx):
if self.alert_channel_id is None:
await ctx.send("Alert channel is not set. Use `!setalertchannel` to set it.")
return
await self.check_earthquakes() # Manually trigger the check for earthquakes

0 comments on commit 53ca177

Please sign in to comment.