From e92deaab6c1d1a1e51526e97abe05ef325d10f22 Mon Sep 17 00:00:00 2001 From: Anubhav <57266248+Anubhav1603@users.noreply.github.com> Date: Mon, 21 Sep 2020 11:08:27 +0530 Subject: Changed List[str]->Optional[List[str]] Co-authored-by: PureFunctor --- bot/exts/evergreen/wikipedia.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'bot') diff --git a/bot/exts/evergreen/wikipedia.py b/bot/exts/evergreen/wikipedia.py index 205f5894..ab01e1ee 100644 --- a/bot/exts/evergreen/wikipedia.py +++ b/bot/exts/evergreen/wikipedia.py @@ -27,15 +27,13 @@ class WikipediaCog(commands.Cog): titles = f'`{index}` [{titles}]({WIKIPEDIA_URL.format(title=titles.replace(" ", "_"))})' return titles - async def search_wikipedia(self, search_term: str) -> Optional[List[str]]: + async def search_wikipedia(self, search_term: str) -> List[str]: """Search wikipedia and return the first page found.""" async with self.http_session.get(SEARCH_API.format(search_term=search_term)) as response: data = await response.json() page = [] search_results = data["query"]["search"] - if not search_results: - return None # Ignore pages with "may refer to" for search_result in search_results: -- cgit v1.2.3