diff options
author | 2022-09-23 22:58:49 +0100 | |
---|---|---|
committer | 2022-09-23 22:58:49 +0100 | |
commit | f9cc77f55a7bac9cff1f5674b36b3f17560f6bfe (patch) | |
tree | 4d9a9684d6c0d8f1f749355353fbadb7fd89960b /bot/exts/utilities/emoji.py | |
parent | Fix issue #1050 (#1097) (diff) | |
parent | Remove all wait_until_guil_available as this is now done in bot-core (diff) |
Merge pull request #1092 from python-discord/bot-core-migration
Diffstat (limited to 'bot/exts/utilities/emoji.py')
-rw-r--r-- | bot/exts/utilities/emoji.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bot/exts/utilities/emoji.py b/bot/exts/utilities/emoji.py index fa438d7f..ec40be01 100644 --- a/bot/exts/utilities/emoji.py +++ b/bot/exts/utilities/emoji.py @@ -10,7 +10,6 @@ from discord.ext import commands from bot.bot import Bot from bot.constants import Colours, ERROR_REPLIES -from bot.utils.extensions import invoke_help_command from bot.utils.pagination import LinePaginator from bot.utils.time import time_since @@ -20,6 +19,9 @@ log = logging.getLogger(__name__) class Emojis(commands.Cog): """A collection of commands related to emojis in the server.""" + def __init__(self, bot: Bot) -> None: + self.bot = bot + @staticmethod def embed_builder(emoji: dict) -> tuple[Embed, list[str]]: """Generates an embed with the emoji names and count.""" @@ -74,7 +76,7 @@ class Emojis(commands.Cog): if emoji is not None: await ctx.invoke(self.info_command, emoji) else: - await invoke_help_command(ctx) + await self.bot.invoke_help_command(ctx) @emoji_group.command(name="count", aliases=("c",)) async def count_command(self, ctx: commands.Context, *, category_query: str = None) -> None: @@ -118,6 +120,6 @@ class Emojis(commands.Cog): await ctx.send(embed=emoji_information) -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Load the Emojis cog.""" - bot.add_cog(Emojis()) + await bot.add_cog(Emojis(bot)) |