aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-04-08 09:09:10 +0300
committerGravatar ks129 <[email protected]>2020-04-08 09:09:10 +0300
commit42e18061a21e0ec1b8a4a692bc8d96f8ef1fd45b (patch)
tree7420f214c4dc5d46ae90e71daefbe8e1fefc77ca
parent(Infractions): Removed unnecessary logging that notify when reason will be tr... (diff)
(Infractions): Moved truncated reason to variable instead on ban coroutine creating.
-rw-r--r--bot/cogs/moderation/infractions.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/bot/cogs/moderation/infractions.py b/bot/cogs/moderation/infractions.py
index d1e77311c..3340744b0 100644
--- a/bot/cogs/moderation/infractions.py
+++ b/bot/cogs/moderation/infractions.py
@@ -245,11 +245,9 @@ class Infractions(InfractionScheduler, commands.Cog):
self.mod_log.ignore(Event.member_remove, user.id)
- action = ctx.guild.ban(
- user,
- reason=textwrap.shorten(reason, width=512, placeholder=" ..."),
- delete_message_days=0
- )
+ truncated_reason = textwrap.shorten(reason, width=512, placeholder=" ...")
+
+ action = ctx.guild.ban(user, reason=truncated_reason, delete_message_days=0)
await self.apply_infraction(ctx, infraction, user, action)
if infraction.get('expires_at') is not None: