aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shivansh-007 <[email protected]>2021-10-19 04:58:34 +0530
committerGravatar Shivansh-007 <[email protected]>2021-10-19 04:58:34 +0530
commit17e6cb4174c102a5e77aaa8515ba77634356b3e4 (patch)
treef5dfefa1ae30b62baae2df8fbee94a12beeabe83
parentRemoving config validation checks (diff)
Make docstring clear about max length
-rw-r--r--bot/exts/moderation/incidents.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bot/exts/moderation/incidents.py b/bot/exts/moderation/incidents.py
index 805b516c9..9a526fa9f 100644
--- a/bot/exts/moderation/incidents.py
+++ b/bot/exts/moderation/incidents.py
@@ -140,7 +140,11 @@ def has_signals(message: discord.Message) -> bool:
def shorten_text(text: str) -> str:
- """Truncate the text if there are over 3 lines or 300 characters, or if it is a single word."""
+ """
+ Truncate the text if there are over 3 lines or 300 characters, or if it is a single word.
+
+ The maximum length of the string would be 303 characters across 3 lines at maximum.
+ """
original_length = len(text)
# Truncate text to a maximum of 300 characters
if len(text) > 300:
@@ -301,7 +305,7 @@ class Incidents(Cog):
self.crawl_task = scheduling.create_task(self.crawl_incidents(), event_loop=self.bot.loop)
async def fetch_webhook(self) -> None:
- """Fetches the incidents webhook object, so we can post message link embeds to it."""
+ """Fetch the incidents webhook object, so we can post message link embeds to it."""
await self.bot.wait_until_guild_available()
self.incidents_webhook = await self.bot.fetch_webhook(Webhooks.incidents)