diff options
author | 2021-08-30 14:48:30 -0400 | |
---|---|---|
committer | 2021-08-30 14:48:30 -0400 | |
commit | 0f63eea5090574123359e84b1ada0efd767cd0c8 (patch) | |
tree | 7f759a49efc57c3b2ffc1396fc151bada42217e1 /bot/exts/evergreen/realpython.py | |
parent | Correct article length check with future proofing (diff) |
Handle single article result
Diffstat (limited to 'bot/exts/evergreen/realpython.py')
-rw-r--r-- | bot/exts/evergreen/realpython.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bot/exts/evergreen/realpython.py b/bot/exts/evergreen/realpython.py index 6ef750a9..5d9e5c5c 100644 --- a/bot/exts/evergreen/realpython.py +++ b/bot/exts/evergreen/realpython.py @@ -53,10 +53,15 @@ class RealPython(commands.Cog): await ctx.send(embed=no_articles) return + if len(articles) == 1: + article_description = "Here is the result:" + else: + article_description = f"Here are the top {len(articles)} results:" + article_embed = Embed( title="Search results - Real Python", url=SEARCH_URL.format(user_search=quote_plus(user_search)), - description=f"Here are the top {len(articles)} results:", + description=article_description, color=Colours.orange, ) |