diff options
author | 2021-02-05 09:28:28 +0530 | |
---|---|---|
committer | 2021-02-05 09:28:28 +0530 | |
commit | f6cccfe73321173d24667321b41f2e2b05f29aac (patch) | |
tree | 2034bd1350713e90cdc701e835c2198b3db75e71 /bot/exts/evergreen/cheatsheet.py | |
parent | Abrupt response, so make the bot type (diff) |
Move repeated code to a single variable
Diffstat (limited to 'bot/exts/evergreen/cheatsheet.py')
-rw-r--r-- | bot/exts/evergreen/cheatsheet.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/exts/evergreen/cheatsheet.py b/bot/exts/evergreen/cheatsheet.py index b3ee0b94..acd77e59 100644 --- a/bot/exts/evergreen/cheatsheet.py +++ b/bot/exts/evergreen/cheatsheet.py @@ -89,13 +89,15 @@ class CheatSheet(commands.Cog): return async with ctx.typing(): + search_string = quote_plus(" ".join(search_terms)) + async with self.bot.http_session.get( - URL.format(search=quote_plus(" ".join(search_terms))) + URL.format(search=search_string) ) as response: result = ANSI_RE.sub("", await response.text()).translate(ESCAPE_TT) is_embed, description = self.result_fmt( - URL.format(search=quote_plus(" ".join(search_terms))), + URL.format(search=search_string), result ) if is_embed: |