Skip to content

Commit

Permalink
Merge pull request #41 from DracoClaw/master
Browse files Browse the repository at this point in the history
Bot Ping Command
  • Loading branch information
EhsanKia authored Jan 19, 2025
2 parents 34c1ab5 + e9407cc commit 4dfec33
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions discord_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ def improve_error_message(message: str) -> str:
message += ' Make sure to record and download the video using the Switch\'s media gallery.'
return message

@bot.slash_command(
name='ping',
description='Responds with the bot latency.',
)
async def ping(ctx: discord.ApplicationContext):
latency = bot.latency * 1000 # Convert to milliseconds
await ctx.respond(f'Pong! Latency is {latency:.2f} ms')

@bot.slash_command(
name='scan',
Expand Down

0 comments on commit 4dfec33

Please sign in to comment.