2024-08-28 10:29:16 +00:00
|
|
|
from discord.ext import commands
|
2024-08-29 08:48:14 +00:00
|
|
|
|
2024-08-28 10:42:03 +00:00
|
|
|
from lib.const import CONST
|
2024-08-29 08:48:14 +00:00
|
|
|
from ui.embeds import Builder
|
2024-08-28 10:29:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Ping(commands.Cog):
|
|
|
|
def __init__(self, bot: commands.Bot):
|
|
|
|
self.bot = bot
|
|
|
|
|
|
|
|
@commands.hybrid_command(
|
|
|
|
name="ping",
|
|
|
|
usage="ping",
|
|
|
|
)
|
|
|
|
async def ping(self, ctx: commands.Context[commands.Bot]) -> None:
|
2024-08-29 08:48:14 +00:00
|
|
|
embed = Builder.create_embed(
|
2024-08-28 13:53:21 +00:00
|
|
|
theme="success",
|
|
|
|
user_name=ctx.author.name,
|
2024-08-28 10:42:03 +00:00
|
|
|
author_text=CONST.STRINGS["ping_author"],
|
|
|
|
description=CONST.STRINGS["ping_pong"],
|
|
|
|
footer_text=CONST.STRINGS["ping_footer"].format(
|
|
|
|
round(1000 * self.bot.latency),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
await ctx.send(embed=embed)
|
2024-08-28 10:29:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
async def setup(bot: commands.Bot) -> None:
|
|
|
|
await bot.add_cog(Ping(bot))
|