2024-05-08 13:47:33 -04:00
|
|
|
from typing import Any, Literal
|
|
|
|
|
|
|
|
from red_commons.logging import RedTraceLogger, getLogger
|
2024-05-08 13:43:33 -04:00
|
|
|
from redbot.core import commands
|
2024-05-08 13:47:33 -04:00
|
|
|
from redbot.core.bot import Red
|
|
|
|
from redbot.core.utils.chat_formatting import humanize_list
|
2024-05-08 13:43:33 -04:00
|
|
|
|
|
|
|
|
2024-05-08 13:54:55 -04:00
|
|
|
class EmojiInfo(commands.Cog):
|
2024-05-08 13:43:33 -04:00
|
|
|
"""Retrieve information about emojis."""
|
|
|
|
|
2024-05-08 13:47:33 -04:00
|
|
|
__author__: list[str] = ["SeaswimmerTheFsh"]
|
|
|
|
__version__: str = "1.0.0"
|
|
|
|
__documentation__: str = "https://seacogs.coastalcommits.com/emoji/"
|
|
|
|
|
|
|
|
def __init__(self, bot: Red) -> None:
|
|
|
|
super().__init__()
|
|
|
|
self.bot: Red = bot
|
|
|
|
self.logger: RedTraceLogger = getLogger(name="red.SeaCogs.Emoji")
|
|
|
|
|
|
|
|
def format_help_for_context(self, ctx: commands.Context) -> str:
|
|
|
|
pre_processed: Any | Literal[''] = super().format_help_for_context(ctx) or ""
|
|
|
|
n: Literal['\n'] | Literal[''] = "\n" if "\n\n" not in pre_processed else ""
|
|
|
|
text: list[str] = [
|
|
|
|
f"{pre_processed}{n}",
|
|
|
|
f"Cog Version: **{self.__version__}**",
|
|
|
|
f"Author: {humanize_list(items=self.__author__)}",
|
|
|
|
f"Documentation: {self.__documentation__}",
|
|
|
|
]
|
|
|
|
return "\n".join(text)
|
|
|
|
|
2024-05-08 13:50:46 -04:00
|
|
|
@commands.hybrid_command(name="emoji")
|
2024-05-08 13:58:58 -04:00
|
|
|
async def emoji(self, ctx: commands.Context, emoji: str, ephemeral: bool = False) -> None:
|
2024-05-08 13:43:33 -04:00
|
|
|
"""Retrieve information about an emoji."""
|
|
|
|
await ctx.send(content=f"Emoji: {emoji}", ephemeral=ephemeral)
|