fix(emoji): fixed the cog refusing to load

This commit is contained in:
Seaswimmer 2024-05-08 13:47:33 -04:00
parent 384ce7fc6d
commit ea1f7a7f8e
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -1,10 +1,35 @@
from typing import Any, Literal
import discord
from red_commons.logging import RedTraceLogger, getLogger
from redbot.core import commands
from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import humanize_list
class Emoji(commands.cog):
"""Retrieve information about emojis."""
__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)
@commands.hybrid_command()
async def emoji(self, ctx: commands.Context, emoji: discord.Emoji, ephemeral: bool = False) -> None:
"""Retrieve information about an emoji."""