diff options
author | 2021-08-08 01:15:12 +0200 | |
---|---|---|
committer | 2021-08-08 01:15:12 +0200 | |
commit | 70d7fc09e875412ae295ee8c4d746c467e73abca (patch) | |
tree | 8ca3982fbf03caffada2fdb1cb4618d49ed5f134 | |
parent | Update Stackoverflow, Wolfram, movie_generator cogs to use aiohttp get params (diff) |
Upgrade code transparency in the StackOverflow Cog
-rw-r--r-- | bot/exts/evergreen/stackoverflow.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/exts/evergreen/stackoverflow.py b/bot/exts/evergreen/stackoverflow.py index 14d20e79..40f149c9 100644 --- a/bot/exts/evergreen/stackoverflow.py +++ b/bot/exts/evergreen/stackoverflow.py @@ -11,7 +11,7 @@ from bot.constants import Colours, Emojis logger = logging.getLogger(__name__) BASE_URL = "https://api.stackexchange.com/2.2/search/advanced" -STACKOW_PARAMS = { +SO_PARAMS = { "order": "desc", "sort": "activity", "site": "stackoverflow" @@ -37,7 +37,7 @@ class Stackoverflow(commands.Cog): @commands.cooldown(1, 15, commands.cooldowns.BucketType.user) async def stackoverflow(self, ctx: commands.Context, *, search_query: str) -> None: """Sends the top 5 results of a search query from stackoverflow.""" - params = STACKOW_PARAMS | {"q": search_query} + params = SO_PARAMS | {"q": search_query} async with self.bot.http_session.get(url=BASE_URL, params=params) as response: if response.status == 200: data = await response.json() |