aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/converters.py2
-rw-r--r--bot/exts/info/doc/_cog.py19
-rw-r--r--bot/exts/info/doc/_inventory_parser.py6
3 files changed, 14 insertions, 13 deletions
diff --git a/bot/converters.py b/bot/converters.py
index 3066eaabb..901ba1cca 100644
--- a/bot/converters.py
+++ b/bot/converters.py
@@ -140,7 +140,7 @@ class PackageName(Converter):
async def convert(cls, ctx: Context, argument: str) -> str:
"""Checks whether the given string is a valid package name."""
if cls.PACKAGE_NAME_RE.search(argument):
- raise BadArgument("The provided package name is not valid, please only use the _ and a-z characters.")
+ raise BadArgument("The provided package name is not valid; please only use the _ and a-z characters.")
return argument
diff --git a/bot/exts/info/doc/_cog.py b/bot/exts/info/doc/_cog.py
index bd9b589ce..ea91b2353 100644
--- a/bot/exts/info/doc/_cog.py
+++ b/bot/exts/info/doc/_cog.py
@@ -207,7 +207,7 @@ class DocCog(commands.Cog):
if not package:
delay = 2*60 if inventory_url not in self.scheduled_inventories else 5*60
- log.info(f"Failed to fetch inventory, attempting again in {delay//60} minutes.")
+ log.info(f"Failed to fetch inventory; attempting again in {delay//60} minutes.")
self.inventory_scheduler.schedule_later(
delay,
api_package_name,
@@ -275,7 +275,7 @@ class DocCog(commands.Cog):
self.scheduled_inventories.clear()
await self.item_fetcher.clear()
- # Run all coroutines concurrently - since each of them performs a HTTP
+ # Run all coroutines concurrently - since each of them performs an HTTP
# request, this speeds up fetching the inventory data heavily.
coros = [
self.update_single(
@@ -322,7 +322,7 @@ class DocCog(commands.Cog):
@commands.group(name='docs', aliases=('doc', 'd'), invoke_without_command=True)
async def docs_group(self, ctx: commands.Context, *, symbol: Optional[str]) -> None:
- """Lookup documentation for Python symbols."""
+ """Look up documentation for Python symbols."""
await ctx.invoke(self.get_command, symbol=symbol)
@docs_group.command(name='getdoc', aliases=('g',))
@@ -414,7 +414,8 @@ class DocCog(commands.Cog):
if await self.update_single(package_name, base_url, inventory_url) is None:
await ctx.send(
- f"Added package `{package_name}` to database but failed to fetch inventory; rescheduled in 2 minutes."
+ f"Added the package `{package_name}` to the database but failed to fetch inventory; "
+ f"trying again in 2 minutes."
)
return
await ctx.send(f"Added package `{package_name}` to database and refreshed inventory.")
@@ -425,7 +426,7 @@ class DocCog(commands.Cog):
"""
Removes the specified package from the database.
- Examples:
+ Example:
!docs deletedoc aiohttp
"""
await self.bot.api_client.delete(f'bot/documentation-links/{package_name}')
@@ -435,12 +436,12 @@ class DocCog(commands.Cog):
# that was from this package is properly deleted.
await self.refresh_inventory()
await doc_cache.delete(package_name)
- await ctx.send(f"Successfully deleted `{package_name}` and refreshed inventory.")
+ await ctx.send(f"Successfully deleted `{package_name}` and refreshed the inventory.")
@docs_group.command(name="refreshdoc", aliases=("rfsh", "r"))
@commands.has_any_role(*MODERATION_ROLES)
async def refresh_command(self, ctx: commands.Context) -> None:
- """Refresh inventories and send differences to channel."""
+ """Refresh inventories and show the difference."""
old_inventories = set(self.base_urls)
with ctx.typing():
await self.refresh_inventory()
@@ -461,6 +462,6 @@ class DocCog(commands.Cog):
@docs_group.command(name="cleardoccache")
@commands.has_any_role(*MODERATION_ROLES)
async def clear_cache_command(self, ctx: commands.Context, package_name: PackageName) -> None:
- """Clear persistent redis cache for `package`."""
+ """Clear the persistent redis cache for `package`."""
await doc_cache.delete(package_name)
- await ctx.send(f"Succesfully cleared cache for {package_name}")
+ await ctx.send(f"Successfully cleared the cache for `{package_name}`.")
diff --git a/bot/exts/info/doc/_inventory_parser.py b/bot/exts/info/doc/_inventory_parser.py
index 23931869b..96df08786 100644
--- a/bot/exts/info/doc/_inventory_parser.py
+++ b/bot/exts/info/doc/_inventory_parser.py
@@ -101,17 +101,17 @@ async def fetch_inventory(
inventory = await _fetch_inventory(client_session, url)
except aiohttp.ClientConnectorError:
log.warning(
- f"Failed to connect to inventory url at {url}, "
+ f"Failed to connect to inventory url at {url}; "
f"trying again ({attempt}/{FAILED_REQUEST_ATTEMPTS})."
)
except aiohttp.ClientError:
log.error(
- f"Failed to get inventory from {url}, "
+ f"Failed to get inventory from {url}; "
f"trying again ({attempt}/{FAILED_REQUEST_ATTEMPTS})."
)
except Exception:
log.exception(
- f"An unexpected error has occurred during fetching of {url}, "
+ f"An unexpected error has occurred during fetching of {url}; "
f"trying again ({attempt}/{FAILED_REQUEST_ATTEMPTS})."
)
else: