diff options
author | 2020-09-17 19:55:47 +0530 | |
---|---|---|
committer | 2020-09-17 19:55:47 +0530 | |
commit | 59684bb86fed1d6254b514fb8233d25b8068b5a3 (patch) | |
tree | 024d720c4df48d383a56285746dd5b19a02d18fd | |
parent | corrected doc string ,changed l_of_list to titles_len and add author channel ... (diff) | |
parent | Removed unnecessary pass (diff) |
Merge branch 'master' of github.com:Anubhav1603/seasonalbot
-rw-r--r-- | bot/exts/evergreen/wikipedia.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/bot/exts/evergreen/wikipedia.py b/bot/exts/evergreen/wikipedia.py index 9c4e900e..9f92c620 100644 --- a/bot/exts/evergreen/wikipedia.py +++ b/bot/exts/evergreen/wikipedia.py @@ -28,15 +28,13 @@ class WikipediaCog(commands.Cog): page = [] search_results = data["query"]["search"] - if len(search_results) == 0: + if not search_results: return None - # we dont like "may refere to" pages. + # Ignore pages with "may refer to" for search_result in search_results: log.info("trying to append titles") - if "may refer to" in search_result["snippet"]: - pass - else: + if "may refer to" not in search_result["snippet"]: page.append(search_result["title"]) log.info("Finished appending titles") return page @@ -53,7 +51,7 @@ class WikipediaCog(commands.Cog): def check(message: Message) -> bool: return message.author.id == ctx.author.id and message.channel == ctx.channel - if titles is None: + if not titles: await ctx.send("Sorry, we could not find a wikipedia article using that search term") return |