aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mbaruh <[email protected]>2023-03-19 15:24:04 +0200
committerGravatar mbaruh <[email protected]>2023-03-19 15:24:04 +0200
commit46e9a1b4574a8840d9db5110cf586db340974c74 (patch)
treecf6acaaa6bb8306584243fd8911ed6edfcd0cda1
parentMerge branch 'main' into mbaruh/timeout (diff)
Mention target user in cap message
-rw-r--r--bot/exts/moderation/infraction/infractions.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bot/exts/moderation/infraction/infractions.py b/bot/exts/moderation/infraction/infractions.py
index 1eb67bee4..7400c82f5 100644
--- a/bot/exts/moderation/infraction/infractions.py
+++ b/bot/exts/moderation/infraction/infractions.py
@@ -32,7 +32,7 @@ if t.TYPE_CHECKING:
MAXIMUM_TIMEOUT_DAYS = timedelta(days=28)
TIMEOUT_CAP_MESSAGE = (
- f"Timeouts can't be longer than {MAXIMUM_TIMEOUT_DAYS.days} days."
+ f"The timeout for {{0}} can't be longer than {MAXIMUM_TIMEOUT_DAYS.days} days."
" I'll pretend that's what you meant."
)
@@ -242,11 +242,12 @@ class Infractions(InfractionScheduler, commands.Cog):
if isinstance(duration, relativedelta):
duration += now
if duration > now + MAXIMUM_TIMEOUT_DAYS:
+ cap_message_for_user = TIMEOUT_CAP_MESSAGE.format(user.mention)
if is_mod_channel(ctx.channel):
- await ctx.reply(f":warning: {TIMEOUT_CAP_MESSAGE}")
+ await ctx.reply(f":warning: {cap_message_for_user}")
else:
await self.bot.get_channel(Channels.mods).send(
- f":warning: {ctx.author.mention} {TIMEOUT_CAP_MESSAGE}"
+ f":warning: {ctx.author.mention} {cap_message_for_user}"
)
duration = now + MAXIMUM_TIMEOUT_DAYS - timedelta(minutes=1) # Duration cap is exclusive.
elif duration > now + MAXIMUM_TIMEOUT_DAYS - timedelta(minutes=1):