From a41d8b32e7c04ea79923531ebfac93b4120484c4 Mon Sep 17 00:00:00 2001 From: onerandomusername Date: Sun, 26 Sep 2021 22:08:46 -0400 Subject: [PATCH] enhancement: embedify all of the meta commands --- modmail/extensions/meta.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/modmail/extensions/meta.py b/modmail/extensions/meta.py index 169efee0..35139d6f 100644 --- a/modmail/extensions/meta.py +++ b/modmail/extensions/meta.py @@ -1,5 +1,6 @@ import logging +import discord from discord.ext import commands from modmail.bot import ModmailBot @@ -21,18 +22,30 @@ def __init__(self, bot: ModmailBot): @commands.command(name="ping", aliases=("pong",)) async def ping(self, ctx: commands.Context) -> None: """Ping the bot to see its latency and state.""" - await ctx.send(f"{round(self.bot.latency * 1000)}ms") + await ctx.send( + embed=discord.Embed( + title=("ping" if ctx.invoked_with.lower() == "pong" else "pong").capitalize() + "!", + description=f"`{round(self.bot.latency * 1000)}`ms", + ) + ) @commands.command(name="uptime") async def uptime(self, ctx: commands.Context) -> None: """Get the current uptime of the bot.""" timestamp = round(float(self.bot.start_time.format("X"))) - await ctx.send(f"Start time: ") + await ctx.send( + embed=discord.Embed(title="Up since:", description=f" ()") + ) @commands.command(name="prefix") async def prefix(self, ctx: commands.Context) -> None: """Return the configured prefix.""" - await ctx.send(f"My current prefix is `{self.bot.config.bot.prefix}`") + await ctx.send( + embed=discord.Embed( + title="Current Prefix", + description=f"My currently configured prefix is `{self.bot.config.bot.prefix}`.", + ) + ) def setup(bot: ModmailBot) -> None: