diff options
author | 2020-10-04 12:24:31 +0530 | |
---|---|---|
committer | 2020-10-04 12:24:31 +0530 | |
commit | fcc345ae802cfe7815e10bc13f972c6925f3c60f (patch) | |
tree | 60d033e875cb5ad306001a9ad89413e3964e8ed0 | |
parent | removed unnecessary logging and added one space (diff) |
cleaned the code
-rw-r--r-- | bot/exts/evergreen/emoji_count.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index 70c5ff53..ef900199 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -24,6 +24,7 @@ class EmojiCount(commands.Cog): title="Emoji Count", timestamp=datetime.datetime.utcnow() ) + if len(emoji) == 1: for key, value in emoji.items(): embed.description = f"There are **{len(value)}** emojis in the **{key}** category" @@ -67,6 +68,7 @@ class EmojiCount(commands.Cog): async def ec(self, ctx: commands.Context, *, emoji: str = None) -> Optional[str]: """Returns embed with emoji category and info given by the user.""" emoji_dict = {} + for a in ctx.guild.emojis: if emoji is None: log.trace("Emoji Category not provided by the user") @@ -74,7 +76,9 @@ class EmojiCount(commands.Cog): elif a.name.split("_")[0] in emoji: log.trace("Emoji Category provided by the user") emoji_dict.update({a.name.split("_")[0]: []}) + emoji_dict = self.emoji_list(ctx, emoji_dict) + if len(emoji_dict) == 0: embed = self.generate_invalid_embed(ctx) else: |