fix: add commands

This commit is contained in:
2026-08-11 19:44:37 +02:00
parent 7467655b8c
commit 36c8231b67
4 changed files with 235 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
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))