aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Steele <[email protected]>2020-12-06 11:16:56 -0500
committerGravatar Steele <[email protected]>2020-12-06 11:16:56 -0500
commit0f66fe3040d70de51ece1aa0de38a88b20000221 (patch)
treee5c2cf93a47be1dd4d2e4814b07c68e57d494041
parentMerge branch 'master' of https://github.com/python-discord/bot into swfarnswo... (diff)
User gets a more detailed message from the bot
Whereas one of my previous commits makes the message the user gets and the infraction that gets recorded the same, the recorded infraction is now shorter, but the message the user gets is more similar to the embed posted in the public channel. We also softened the language of the user-facing message a bit.
-rw-r--r--bot/exts/moderation/infraction/superstarify.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/bot/exts/moderation/infraction/superstarify.py b/bot/exts/moderation/infraction/superstarify.py
index e7d1c4da8..1d512a4c7 100644
--- a/bot/exts/moderation/infraction/superstarify.py
+++ b/bot/exts/moderation/infraction/superstarify.py
@@ -136,9 +136,8 @@ class Superstarify(InfractionScheduler, Cog):
# Post the infraction to the API
old_nick = member.display_name
- 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)
+ infraction_reason = f'Old nickname: {old_nick}. {reason}'
+ infraction = await _utils.post_infraction(ctx, member, "superstar", infraction_reason, duration, active=True)
id_ = infraction["id"]
forced_nick = self.get_nick(id_, member.id)
@@ -158,9 +157,21 @@ class Superstarify(InfractionScheduler, Cog):
New nickname: `{forced_nick}`
""").strip()
+ formatted_reason = f'**Additional details:** {reason}\n\n' if reason else ''
+
+ embed_reason = (
+ f"Your previous nickname, **{old_nick}**, "
+ f"didn't comply with our nickname policy. "
+ f"Your new nickname will be **{forced_nick}**.\n\n"
+ f"{formatted_reason}"
+ f"You will be unable to change your nickname until **{expiry_str}**. "
+ "If you're confused by this, please read our "
+ f"[official nickname policy]({NICKNAME_POLICY_URL})."
+ )
+
successful = await self.apply_infraction(
ctx, infraction, member, action(),
- user_reason=reason,
+ user_reason=embed_reason,
additional_info=nickname_info
)
@@ -171,14 +182,7 @@ class Superstarify(InfractionScheduler, Cog):
embed = Embed(
title="Congratulations!",
colour=constants.Colours.soft_orange,
- description=(
- f"Your previous nickname, **{old_nick}**, "
- f"was so bad that we have decided to change it. "
- f"Your new nickname will be **{forced_nick}**.\n\n"
- f"You will be unable to change your nickname until **{expiry_str}**.\n\n"
- "If you're confused by this, please read our "
- f"[official nickname policy]({NICKNAME_POLICY_URL})."
- )
+ description=embed_reason
)
await ctx.send(embed=embed)