Files
Goonerdle-bot/Commands/ping.py
T
2026-08-11 19:44:37 +02:00

21 lines
613 B
Python
Executable File

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