diff options
| author | 2020-04-08 09:20:04 +0300 | |
|---|---|---|
| committer | 2020-04-08 09:20:04 +0300 | |
| commit | 27e15c42e71f3d2df828d13a5e92c53c664b4431 (patch) | |
| tree | f056fb07e9a1fd7662f5b1e83cde8f6e21f9ac67 | |
| parent | (Superstarify, Scheduler): Added reason shortening for ModLog. (diff) | |
(Scheduler): Changed reason truncating in `apply_infraction` from 1900 chars to 1500, added shortening to end message too.
| -rw-r--r-- | bot/cogs/moderation/scheduler.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/cogs/moderation/scheduler.py b/bot/cogs/moderation/scheduler.py index 7404ec8ac..345f08f19 100644 --- a/bot/cogs/moderation/scheduler.py +++ b/bot/cogs/moderation/scheduler.py @@ -85,7 +85,7 @@ class InfractionScheduler(Scheduler): infr_type = infraction["type"] icon = utils.INFRACTION_ICONS[infr_type][0] # Truncate reason when it's too long to avoid raising error on sending ModLog entry - reason = textwrap.shorten(infraction["reason"], width=1900, placeholder="...") + reason = textwrap.shorten(infraction["reason"], width=1500, placeholder="...") expiry = time.format_infraction_with_duration(infraction["expires_at"]) id_ = infraction['id'] @@ -128,7 +128,7 @@ class InfractionScheduler(Scheduler): f"Infraction #{id_} actor is bot; including the reason in the confirmation message." ) - end_msg = f" (reason: {infraction['reason']})" + end_msg = f" (reason: {textwrap.shorten(infraction['reason'], width=1500, placeholder='...')})" elif ctx.channel.id not in STAFF_CHANNELS: log.trace( f"Infraction #{id_} context is not in a staff channel; omitting infraction count." |