import discord from discord import app_commands from discord.ext import commands class ping(commands.Cog): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_ready(self): print("Ping Online") @app_commands.command(name="ping", description="Pong!") async def ping(self, interaction: discord.Interaction): await interaction.response.send_message(f":ping_pong:**Pong!**\nLatency: {round(self.bot.latency * 1000)}ms") async def setup(bot): await bot.add_cog(ping(bot))