From 97d68569e0f6cfa762e20db048a4ad3a9f18d80a Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Sat, 3 Aug 2024 01:27:44 +0100 Subject: [PATCH] Add latency command --- app/modules/latency.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 app/modules/latency.py diff --git a/app/modules/latency.py b/app/modules/latency.py new file mode 100644 index 0000000..87ba51d --- /dev/null +++ b/app/modules/latency.py @@ -0,0 +1,9 @@ +import niobot + + +class LatencyModule(niobot.Module): + @niobot.command("latency") + async def latency(self, ctx: niobot.Context): + """See the bot's latency.""" + latency = ctx.latency + return await ctx.respond("Latency: {:.2f}ms".format(latency * 1000))