"""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