diff options
author | 2020-09-22 17:24:11 +0530 | |
---|---|---|
committer | 2020-09-22 17:24:11 +0530 | |
commit | 3ec47214966f9547b104c416f5ff37e1415536b3 (patch) | |
tree | c61f5b013b7baabd280f4dc66d5f29167ce2109e /bot | |
parent | handled exceptiom of ContentTypeError at search_wikipedia (diff) |
changed List[str]->Optional[List[str]]
Diffstat (limited to 'bot')
-rw-r--r-- | bot/exts/evergreen/wikipedia.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/exts/evergreen/wikipedia.py b/bot/exts/evergreen/wikipedia.py index 6cf8f592..f8711f90 100644 --- a/bot/exts/evergreen/wikipedia.py +++ b/bot/exts/evergreen/wikipedia.py @@ -1,7 +1,7 @@ import asyncio import datetime import logging -from typing import List +from typing import List, Optional from aiohttp import client_exceptions from discord import Color, Embed, Message @@ -27,7 +27,7 @@ class WikipediaCog(commands.Cog): """Formating wikipedia link with index and title.""" return f'`{index}` [{title}]({WIKIPEDIA_URL.format(title=title.replace(" ", "_"))})' - async def search_wikipedia(self, search_term: str) -> List[str]: + async def search_wikipedia(self, search_term: str) -> Optional[List[str]]: """Search wikipedia and return the first 10 pages found.""" pages = [] async with self.http_session.get(SEARCH_API.format(search_term=search_term)) as response: |