diff options
-rw-r--r-- | bot/cogs/moderation/infractions.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/cogs/moderation/infractions.py b/bot/cogs/moderation/infractions.py index 34c439ffe..2c075f436 100644 --- a/bot/cogs/moderation/infractions.py +++ b/bot/cogs/moderation/infractions.py @@ -416,6 +416,7 @@ class Infractions(Scheduler, commands.Cog): expiry_log_text = f"Expires: {expiry}" if expiry else "" log_title = "applied" log_content = None + reason_msg = "" # DM the user about the infraction if it's not a shadow/hidden infraction. if not infraction["hidden"]: @@ -430,6 +431,9 @@ class Infractions(Scheduler, commands.Cog): dm_log_text = "\nDM: **Failed**" log_content = ctx.author.mention + if infraction["actor"] == self.bot.user.id: + reason_msg = f" (reason: {infraction['reason']})" + # Execute the necessary actions to apply the infraction on Discord. if action_coro: try: @@ -445,7 +449,7 @@ class Infractions(Scheduler, commands.Cog): log_title = "failed to apply" # Send a confirmation message to the invoking context. - await ctx.send(f"{dm_result}{confirm_msg} **{infr_type}** to {user.mention}{expiry_msg}.") + await ctx.send(f"{dm_result}{confirm_msg} **{infr_type}** to {user.mention}{expiry_msg}{reason_msg}.") # Send a log message to the mod log. await self.mod_log.send_log_message( |