- Core bot with slash command tree (discord.py 2.7.x compatible) - Commands: /ping, /info, /hello, /emoji, /app-emoji - Admin: /upload-emoji, /list-emojis, /delete-emoji - GIF emote detection and reaction handling - Message reactions with percentage-based triggers and cooldowns - Voice/music cog with YTDLSource, skip, volume, pause, resume, stop - Global error handler and voice state change logging - Environment config via .env (DISCORD_TOKEN, COMMAND_PREFIX, etc.)
31 lines
799 B
Python
31 lines
799 B
Python
"""Ping slash command."""
|
|
|
|
import discord
|
|
from discord.app_commands import Command
|
|
from discord.ext import commands
|
|
|
|
|
|
async def ping(interaction: discord.Interaction) -> None:
|
|
"""Check the bot's latency."""
|
|
latency = round(interaction.client.latency * 1000)
|
|
await interaction.response.send_message(
|
|
f"Pong! Latency: {latency}ms",
|
|
ephemeral=True,
|
|
)
|
|
|
|
|
|
ping.__signature__ = None # type: ignore
|
|
|
|
|
|
async def info(interaction: discord.Interaction) -> None:
|
|
"""Show bot information."""
|
|
await interaction.response.send_message(
|
|
f"**{interaction.client.user.name}**\n"
|
|
f"ID: {interaction.client.user.id}\n"
|
|
f"Bot! (ping: {round(interaction.client.latency * 1000)}ms)",
|
|
ephemeral=True,
|
|
)
|
|
|
|
|
|
info.__signature__ = None # type: ignore
|