From aa4632b4ddf90aeed32ef8a12769443f61bbe88e Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Wed, 8 Jan 2025 16:03:24 -0500 Subject: [PATCH] feat(commands/bot): add ping --- commands/bot.py | 11 +++++++++++ commands/utils.py | 1 + core.py | 2 ++ 3 files changed, 14 insertions(+) diff --git a/commands/bot.py b/commands/bot.py index 7b6bd3a..2516bfc 100644 --- a/commands/bot.py +++ b/commands/bot.py @@ -84,6 +84,17 @@ async def uptime(message): ) +async def ping(message): + await utils.reply( + message, + embed=disnake.Embed( + title="Pong :ping_pong:", + description=f"Latency: **{round(client.latency * 1000, 1)} ms**", + color=EMBED_COLOR, + ), + ) + + async def help(message): await utils.reply( message, diff --git a/commands/utils.py b/commands/utils.py index 20d8fb8..df57a37 100644 --- a/commands/utils.py +++ b/commands/utils.py @@ -13,6 +13,7 @@ class Command(Enum): JOIN = "join" LEAVE = "leave" PAUSE = "pause" + PING = "ping" PLAY = "play" PLAYING = "playing" PURGE = "purge" diff --git a/core.py b/core.py index ea2ebb3..6016765 100644 --- a/core.py +++ b/core.py @@ -145,6 +145,8 @@ async def on_message(message, edited=False): await commands.voice.fast_forward(message) case C.STATUS: await commands.bot.status(message) + case C.PING: + await commands.bot.ping(message) except Exception as e: await utils.reply( message,