aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2020-06-29 02:42:27 +0200
committerGravatar Numerlor <[email protected]>2020-06-29 02:42:27 +0200
commitb6dc7536fd90e27f5dfdf3204dc2f17917d78ee2 (patch)
tree18518bbdd3ad834e928c9ce1e482ba35c0e6ff6c
parentAdd stat for packages of fetched symbols. (diff)
Trigger typing in converter instead of command.
The converter does a web request so triggering typing in the command itself left out a period where the bot seemed inactive.
-rw-r--r--bot/cogs/doc.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/bot/cogs/doc.py b/bot/cogs/doc.py
index e1c25d173..50aa9bbad 100644
--- a/bot/cogs/doc.py
+++ b/bot/cogs/doc.py
@@ -151,6 +151,7 @@ class InventoryURL(commands.Converter):
@staticmethod
async def convert(ctx: commands.Context, url: str) -> str:
"""Convert url to Intersphinx inventory URL."""
+ await ctx.trigger_typing()
try:
intersphinx.fetch_inventory(SPHINX_MOCK_APP, '', url)
except AttributeError:
@@ -504,10 +505,7 @@ class Doc(commands.Cog):
f"Inventory URL: {inventory_url}"
)
- # Rebuilding the inventory can take some time, so lets send out a
- # typing event to show that the Bot is still working.
- async with ctx.typing():
- await self.update_single(package_name, base_url, inventory_url)
+ await self.update_single(package_name, base_url, inventory_url)
await ctx.send(f"Added package `{package_name}` to database and refreshed inventory.")
@docs_group.command(name='delete', aliases=('remove', 'rm', 'd'))