diff options
author | 2021-02-05 09:27:25 +0530 | |
---|---|---|
committer | 2021-02-05 09:27:25 +0530 | |
commit | 3d30a1ff9103fc59bd7fcc0ec8b1e7304beb08d4 (patch) | |
tree | 1aeedf312cea77f70a1408651f98a458b217ab47 /bot/exts/evergreen/cheatsheet.py | |
parent | Merge branch 'feature/cheat.sh' of https://github.com/Shivansh-007/sir-lanceb... (diff) |
Abrupt response, so make the bot type
Diffstat (limited to 'bot/exts/evergreen/cheatsheet.py')
-rw-r--r-- | bot/exts/evergreen/cheatsheet.py | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/bot/exts/evergreen/cheatsheet.py b/bot/exts/evergreen/cheatsheet.py index f650e3b0..b3ee0b94 100644 --- a/bot/exts/evergreen/cheatsheet.py +++ b/bot/exts/evergreen/cheatsheet.py @@ -88,19 +88,20 @@ class CheatSheet(commands.Cog): ): return - async with self.bot.http_session.get( - URL.format(search=quote_plus(" ".join(search_terms))) - ) 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))), - result - ) - if is_embed: - await ctx.send(embed=description) - else: - await ctx.send(content=description) + async with ctx.typing(): + async with self.bot.http_session.get( + URL.format(search=quote_plus(" ".join(search_terms))) + ) 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))), + result + ) + if is_embed: + await ctx.send(embed=description) + else: + await ctx.send(content=description) def setup(bot: commands.Bot) -> None: |