diff options
author | 2021-08-02 21:04:57 +0200 | |
---|---|---|
committer | 2021-08-02 21:04:57 +0200 | |
commit | e2157f90975cc37e9970d300bb8d2abf21b0a09b (patch) | |
tree | 274a1f4a514824bb7ba889dacc3b9bcb59510747 | |
parent | Simplify condition by assigning group and name before it (diff) |
Make return condition clearer
-rw-r--r-- | bot/exts/info/tags.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/bot/exts/info/tags.py b/bot/exts/info/tags.py index fb7f60aa7..beabade58 100644 --- a/bot/exts/info/tags.py +++ b/bot/exts/info/tags.py @@ -398,16 +398,17 @@ class Tags(Cog): tag_group = tag_name_or_group embed = await self.get_tag_embed(ctx, TagIdentifier(tag_group, tag_name)) - if embed is not None: - if embed is not COOLDOWN.obj: - await wait_for_deletion( - await ctx.send(embed=embed), - (ctx.author.id,) - ) - return True - else: + if embed is None: return False + if embed is not COOLDOWN.obj: + await wait_for_deletion( + await ctx.send(embed=embed), + (ctx.author.id,) + ) + # A valid tag was found and was either sent, or is on cooldown + return True + def setup(bot: Bot) -> None: """Load the Tags cog.""" |