aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-04-09 11:34:54 +0300
committerGravatar ks129 <[email protected]>2020-04-09 11:34:54 +0300
commit472b58b3fb1b3d8695d9de1a13ce92f129e6bcc4 (patch)
tree7f2048cbe05d993735204fa384764e3706fd2c0f
parent(Watchchannel): Added footer shortening. (diff)
(Big Brother): Added truncating reason.
-rw-r--r--bot/cogs/watchchannels/bigbrother.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/cogs/watchchannels/bigbrother.py b/bot/cogs/watchchannels/bigbrother.py
index 903c87f85..69df849f0 100644
--- a/bot/cogs/watchchannels/bigbrother.py
+++ b/bot/cogs/watchchannels/bigbrother.py
@@ -1,4 +1,5 @@
import logging
+import textwrap
from collections import ChainMap
from discord.ext.commands import Cog, Context, group
@@ -97,8 +98,8 @@ class BigBrother(WatchChannel, Cog, name="Big Brother"):
if len(history) > 1:
total = f"({len(history) // 2} previous infractions in total)"
- end_reason = history[0]["reason"]
- start_reason = f"Watched: {history[1]['reason']}"
+ end_reason = textwrap.shorten(history[0]["reason"], width=500, placeholder="...")
+ start_reason = f"Watched: {textwrap.shorten(history[1]['reason'], width=500, placeholder='...')}"
msg += f"\n\nUser's previous watch reasons {total}:```{start_reason}\n\n{end_reason}```"
else:
msg = ":x: Failed to post the infraction: response was empty."