diff options
| author | 2021-05-17 12:50:04 -0500 | |
|---|---|---|
| committer | 2021-05-17 12:50:04 -0500 | |
| commit | a174b78114d4204e74e11a820ddf36f00d293112 (patch) | |
| tree | 9404dbf50e3f11c7c83b782733aa30d7d15fcae2 /bot/exts/evergreen/emoji.py | |
| parent | Remove comments and update docstrings (diff) | |
| parent | Merge pull request #726 from Objectivitix/main (diff) | |
Merge branch 'main' into http_status_command_randomness
Diffstat (limited to '')
| -rw-r--r-- | bot/exts/evergreen/emoji.py | 18 | 
1 files changed, 8 insertions, 10 deletions
| diff --git a/bot/exts/evergreen/emoji.py b/bot/exts/evergreen/emoji.py index fa3044e3..11615214 100644 --- a/bot/exts/evergreen/emoji.py +++ b/bot/exts/evergreen/emoji.py @@ -8,6 +8,7 @@ from typing import List, Optional, Tuple  from discord import Color, Embed, Emoji  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 @@ -19,9 +20,6 @@ log = logging.getLogger(__name__)  class Emojis(commands.Cog):      """A collection of commands related to emojis in the server.""" -    def __init__(self, bot: commands.Bot): -        self.bot = bot -      @staticmethod      def embed_builder(emoji: dict) -> Tuple[Embed, List[str]]:          """Generates an embed with the emoji names and count.""" @@ -48,9 +46,9 @@ class Emojis(commands.Cog):                  else:                      emoji_info = f"There is **{len(category_emojis)}** emoji in the **{category_name}** category."                  if emoji_choice.animated: -                    msg.append(f'<a:{emoji_choice.name}:{emoji_choice.id}> {emoji_info}') +                    msg.append(f"<a:{emoji_choice.name}:{emoji_choice.id}> {emoji_info}")                  else: -                    msg.append(f'<:{emoji_choice.name}:{emoji_choice.id}> {emoji_info}') +                    msg.append(f"<:{emoji_choice.name}:{emoji_choice.id}> {emoji_info}")          return embed, msg      @staticmethod @@ -66,7 +64,7 @@ class Emojis(commands.Cog):          for emoji in emojis:              emoji_dict[emoji.name.split("_")[0]].append(emoji) -        error_comp = ', '.join(emoji_dict) +        error_comp = ", ".join(emoji_dict)          msg.append(f"These are the valid emoji categories:\n```{error_comp}```")          return embed, msg @@ -86,7 +84,7 @@ class Emojis(commands.Cog):          if not ctx.guild.emojis:              await ctx.send("No emojis found.")              return -        log.trace(f"Emoji Category {'' if category_query else 'not '}provided by the user") +        log.trace(f"Emoji Category {'' if category_query else 'not '}provided by the user.")          for emoji in ctx.guild.emojis:              emoji_category = emoji.name.split("_")[0] @@ -120,6 +118,6 @@ class Emojis(commands.Cog):          await ctx.send(embed=emoji_information) -def setup(bot: commands.Bot) -> None: -    """Add the Emojis cog into the bot.""" -    bot.add_cog(Emojis(bot)) +def setup(bot: Bot) -> None: +    """Load the Emojis cog.""" +    bot.add_cog(Emojis()) | 
