ia_bot/commands/emoji.py
Benjamyn 43ca943cb8 feat: A.B.I.N.A.S.H Discord bot with GIF emotes, slash commands, and music
- 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.)
2026-08-27 16:05:27 +10:00

38 lines
1.1 KiB
Python

"""Emoji slash commands."""
import discord
from discord.app_commands import Command
from discord.ext import commands
async def emoji(interaction: discord.Interaction, *, name: str) -> None:
"""Send a custom emoji by name (requires colon prefix)."""
emoji_str = f":{name}:"
await interaction.response.send_message(emoji_str, ephemeral=True)
emoji.__signature__ = None # type: ignore
async def app_emoji(interaction: discord.Interaction, *, emoji_id: int) -> None:
"""Fetch an application-owned emoji by ID."""
try:
emoji = await interaction.client.fetch_application_emoji(emoji_id)
await interaction.response.send_message(
f"Emoji: `{emoji.name}` — {emoji.url}",
ephemeral=True,
)
except discord.NotFound:
await interaction.response.send_message(
f"Emoji with ID {emoji_id} not found.",
ephemeral=True,
)
except discord.HTTPException as e:
await interaction.response.send_message(
f"Error fetching emoji: {e}",
ephemeral=True,
)
app_emoji.__signature__ = None # type: ignore