diff options
| author | 2020-12-05 12:08:44 -0500 | |
|---|---|---|
| committer | 2020-12-05 12:08:44 -0500 | |
| commit | f537768034a2c9791ca08a91c66b9f97aef8edca (patch) | |
| tree | f8351d8067baeb6514ae922ab360f4ae85f79e16 | |
| parent | Merge PR #1214 - Gracefully handle socket.gaierro in AsyncStatsClient (diff) | |
Bot relays the infraction reason in the DM.
Previously, the infraction DM from the bot gave a formulaic message about the nickname policy. It now gives a slightly different message along with the reason given by the mod. This means that the message the user gets and the infraction reason that gets recorded are now the same.
| -rw-r--r-- | bot/exts/moderation/infraction/superstarify.py | 12 | 
1 files changed, 6 insertions, 6 deletions
diff --git a/bot/exts/moderation/infraction/superstarify.py b/bot/exts/moderation/infraction/superstarify.py index 96dfb562f..a4327fb95 100644 --- a/bot/exts/moderation/infraction/superstarify.py +++ b/bot/exts/moderation/infraction/superstarify.py @@ -111,7 +111,7 @@ class Superstarify(InfractionScheduler, Cog):          member: Member,          duration: Expiry,          *, -        reason: str = None, +        reason: str = '',      ) -> None:          """          Temporarily force a random superstar name (like Taylor Swift) to be the user's nickname. @@ -128,15 +128,16 @@ class Superstarify(InfractionScheduler, Cog):          Alternatively, an ISO 8601 timestamp can be provided for the duration. -        An optional reason can be provided. If no reason is given, the original name will be shown -        in a generated reason. +        An optional reason can be provided, which would be added to a message stating their old nickname +        and linking to the nickname policy.          """          if await _utils.get_active_infraction(ctx, member, "superstar"):              return          # Post the infraction to the API          old_nick = member.display_name -        reason = reason or f"old nick: {old_nick}" +        reason = (f"Nickname '{old_nick}' does not comply with our [nickname policy]({NICKNAME_POLICY_URL}). " +                  f"{reason}")          infraction = await _utils.post_infraction(ctx, member, "superstar", reason, duration, active=True)          id_ = infraction["id"] @@ -152,7 +153,6 @@ class Superstarify(InfractionScheduler, Cog):          old_nick = escape_markdown(old_nick)          forced_nick = escape_markdown(forced_nick) -        superstar_reason = f"Your nickname didn't comply with our [nickname policy]({NICKNAME_POLICY_URL})."          nickname_info = textwrap.dedent(f"""              Old nickname: `{old_nick}`              New nickname: `{forced_nick}` @@ -160,7 +160,7 @@ class Superstarify(InfractionScheduler, Cog):          successful = await self.apply_infraction(              ctx, infraction, member, action(), -            user_reason=superstar_reason, +            user_reason=reason,              additional_info=nickname_info          )  |