aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-04-05 18:13:38 +0300
committerGravatar ks129 <[email protected]>2020-04-05 18:13:38 +0300
commitec8cc8b02b0823deaa4ea2c97801d16d6aef5244 (patch)
tree28633249cdfcc6913808cdb2a33f46c3d96351d8
parent(Ban and Kick): Replaced force reason truncating with `textwrap.shorten`. (diff)
(Ban and Kick): Applied simplification to reason truncating.
-rw-r--r--bot/cogs/moderation/infractions.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/cogs/moderation/infractions.py b/bot/cogs/moderation/infractions.py
index a0bdf0d97..5bdea5755 100644
--- a/bot/cogs/moderation/infractions.py
+++ b/bot/cogs/moderation/infractions.py
@@ -229,7 +229,7 @@ class Infractions(InfractionScheduler, commands.Cog):
if len(reason) > 512:
log.info("Kick reason is longer than 512 characters. Reason will be truncated for Audit Log.")
- action = user.kick(textwrap.shorten(reason, width=509, placeholder="...") if len(reason) > 512 else reason)
+ action = user.kick(reason=textwrap.shorten(reason, width=509, placeholder="..."))
await self.apply_infraction(ctx, infraction, user, action)
@respect_role_hierarchy()
@@ -253,7 +253,7 @@ class Infractions(InfractionScheduler, commands.Cog):
action = ctx.guild.ban(
user,
- reason=textwrap.shorten(reason, width=509, placeholder="...") if len(reason) > 512 else reason,
+ reason=textwrap.shorten(reason, width=509, placeholder="..."),
delete_message_days=0
)
await self.apply_infraction(ctx, infraction, user, action)