Skip to content

Commit

Permalink
Purge ban now says 'purge ban' on user purge ban.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xithrius committed Mar 8, 2021
1 parent cd71b84 commit 1255bbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bot/exts/moderation/infraction/_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ async def apply_infraction(
total = len(infractions)
end_msg = f" (#{id_} ; {total} infraction{ngettext('', 's', total)} total)"

purge = infraction['purge']

# Execute the necessary actions to apply the infraction on Discord.
if action_coro:
log.trace(f"Awaiting the infraction #{id_} application action coroutine.")
Expand Down Expand Up @@ -210,7 +212,7 @@ async def apply_infraction(
log.error(f"Deletion of {infr_type} infraction #{id_} failed with error code {e.status}.")
infr_message = ""
else:
infr_message = f" **{' '.join(infr_type.split('_'))}** to {user.mention}{expiry_msg}{end_msg}"
infr_message = f" **{purge}{' '.join(infr_type.split('_'))}** to {user.mention}{expiry_msg}{end_msg}"

# Send a confirmation message to the invoking context.
log.trace(f"Sending infraction #{id_} confirmation message.")
Expand All @@ -234,7 +236,7 @@ async def apply_infraction(
footer=f"ID {infraction['id']}"
)

log.info(f"Applied {infr_type} infraction #{id_} to {user}.")
log.info(f"Applied {purge}{infr_type} infraction #{id_} to {user}.")
return not failed

async def pardon_infraction(
Expand Down
2 changes: 2 additions & 0 deletions bot/exts/moderation/infraction/infractions.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ async def apply_ban(
if infraction is None:
return

infraction["purge"] = "purge " if purge_days else ""

self.mod_log.ignore(Event.member_remove, user.id)

if reason:
Expand Down

0 comments on commit 1255bbe

Please sign in to comment.