aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2019-09-30 22:49:32 -0700
committerGravatar MarkKoz <[email protected]>2019-10-01 18:25:33 -0700
commit3bdb9001063eb572be3ea31b519336deb445c9f2 (patch)
tree97c510a7f165c2cbc5987e0d58f96171a5d337c7
parentFix stars.json resource test (diff)
Add infraction pardon icons to dictionary
-rw-r--r--bot/cogs/moderation/infractions.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/bot/cogs/moderation/infractions.py b/bot/cogs/moderation/infractions.py
index 63fa9d87a..4973b1b1a 100644
--- a/bot/cogs/moderation/infractions.py
+++ b/bot/cogs/moderation/infractions.py
@@ -22,12 +22,13 @@ from .utils import (
log = logging.getLogger(__name__)
+# apply icon, pardon icon
INFRACTION_ICONS = {
- "mute": Icons.user_mute,
- "kick": Icons.sign_out,
- "ban": Icons.user_ban,
- "warning": Icons.user_warn,
- "note": Icons.user_warn,
+ "mute": (Icons.user_mute, Icons.user_unmute),
+ "kick": (Icons.sign_out, None),
+ "ban": (Icons.user_ban, Icons.user_unban),
+ "warning": (Icons.user_warn, None),
+ "note": (Icons.user_warn, None),
}
RULES_URL = "https://pythondiscord.com/pages/rules"
APPEALABLE_INFRACTIONS = ("ban", "mute")
@@ -430,7 +431,7 @@ class Infractions(Scheduler, Cog):
colour=Colour(Colours.soft_red)
)
- icon_url = INFRACTION_ICONS.get(infr_type, Icons.token_removed)
+ icon_url = INFRACTION_ICONS[infr_type][0]
embed.set_author(name="Infraction Information", icon_url=icon_url, url=RULES_URL)
embed.title = f"Please review our rules over at {RULES_URL}"
embed.url = RULES_URL
@@ -489,7 +490,7 @@ class Infractions(Scheduler, Cog):
) -> None:
"""Apply an infraction to the user, log the infraction, and optionally notify the user."""
infr_type = infraction["type"]
- icon = INFRACTION_ICONS[infr_type]
+ icon = INFRACTION_ICONS[infr_type][0]
reason = infraction["reason"]
expiry = infraction["expires_at"]