diff options
author | 2019-10-25 17:02:04 -0700 | |
---|---|---|
committer | 2019-10-25 17:11:45 -0700 | |
commit | 47f07ff3a7be12096df4a2f1463c7bf2357761e9 (patch) | |
tree | 6a5742ab91def5619f136bdb8c6d0ec8a9407b13 | |
parent | Moderation: make infraction notification embed title lowercase (diff) |
Superstarify: return None in _pardon_action for supported types
-rw-r--r-- | bot/cogs/moderation/superstarify.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/cogs/moderation/superstarify.py b/bot/cogs/moderation/superstarify.py index f43f3d027..c66222e5a 100644 --- a/bot/cogs/moderation/superstarify.py +++ b/bot/cogs/moderation/superstarify.py @@ -190,11 +190,14 @@ class Superstarify(InfractionScheduler, Cog): async def _pardon_action(self, infraction: utils.Infraction) -> t.Optional[t.Dict[str, str]]: """Pardon a superstar infraction and return a log dict.""" + if infraction["type"] != "superstar": + return + guild = self.bot.get_guild(constants.Guild.id) user = guild.get_member(infraction["user"]) # Don't bother sending a notification if the user left the guild. - if infraction["type"] != "superstar" or not user: + if not user: return {} # DM the user about the expiration. |