aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mbaruh <[email protected]>2023-01-20 17:04:18 +0200
committerGravatar mbaruh <[email protected]>2023-01-20 17:04:18 +0200
commitb7297dedbea33a7029d7aee4b69b55fdae801487 (patch)
tree7eab3191c00418c7c0407648e2c03c2fed37ea14
parentfix: Correctly handle author being a User (diff)
Show infraction name in passive form in alert
-rw-r--r--bot/exts/filtering/_settings_types/actions/infraction_and_notification.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/bot/exts/filtering/_settings_types/actions/infraction_and_notification.py b/bot/exts/filtering/_settings_types/actions/infraction_and_notification.py
index d60bcac5b..215afabdd 100644
--- a/bot/exts/filtering/_settings_types/actions/infraction_and_notification.py
+++ b/bot/exts/filtering/_settings_types/actions/infraction_and_notification.py
@@ -18,6 +18,17 @@ from bot.exts.filtering._utils import FakeContext
log = get_logger(__name__)
+passive_form = {
+ "BAN": "banned",
+ "KICK": "kicked",
+ "MUTE": "muted",
+ "VOICE_MUTE": "voice muted",
+ "SUPERSTAR": "superstarred",
+ "WARNING": "warned",
+ "WATCH": "watch",
+ "NOTE": "noted",
+}
+
class Infraction(Enum):
"""An enumeration of infraction types. The lower the value, the higher it is on the hierarchy."""
@@ -146,7 +157,7 @@ class InfractionAndNotification(ActionEntry):
await self.infraction_type.invoke(
ctx.author, channel, alerts_channel, self.infraction_duration, self.infraction_reason
)
- ctx.action_descriptions.append(self.infraction_type.name.lower())
+ ctx.action_descriptions.append(passive_form[self.infraction_type.name])
def __or__(self, other: ActionEntry):
"""