aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/cheatsheet.py
diff options
context:
space:
mode:
authorGravatar Shivansh-007 <[email protected]>2021-02-05 09:28:28 +0530
committerGravatar Shivansh-007 <[email protected]>2021-02-05 09:28:28 +0530
commitf6cccfe73321173d24667321b41f2e2b05f29aac (patch)
tree2034bd1350713e90cdc701e835c2198b3db75e71 /bot/exts/evergreen/cheatsheet.py
parentAbrupt 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.py6
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: