diff options
author | 2021-10-10 11:02:46 +0100 | |
---|---|---|
committer | 2021-10-10 21:57:56 +0100 | |
commit | 1df1527401169479a2e72d1a3b1838907954a73c (patch) | |
tree | 9634f44b42c0a066de9a48d0feb688977568a7c0 | |
parent | Merge branch 'main' into fix-infract-then-dm (diff) |
Remove redundant `else` clauses
-rw-r--r-- | bot/exts/moderation/infraction/_scheduler.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/bot/exts/moderation/infraction/_scheduler.py b/bot/exts/moderation/infraction/_scheduler.py index 6f1af86d3..f6fa5a3c3 100644 --- a/bot/exts/moderation/infraction/_scheduler.py +++ b/bot/exts/moderation/infraction/_scheduler.py @@ -165,13 +165,10 @@ class InfractionScheduler: dm_result = f"{constants.Emojis.failmail} " dm_log_text = "\nDM: **Failed**" - # Accordingly display whether the user was successfully notified via DM. + # Accordingly update whether the user was successfully notified via DM. if await _utils.notify_infraction(user, infr_type.replace("_", " ").title(), expiry, user_reason, icon): dm_result = ":incoming_envelope: " dm_log_text = "\nDM: Sent" - else: - dm_result = f"{constants.Emojis.failmail} " - dm_log_text = "\nDM: **Failed**" end_msg = "" if infraction["actor"] == self.bot.user.id: @@ -233,13 +230,13 @@ class InfractionScheduler: # If we need to DM and haven't already tried to if not infraction["hidden"] and infr_type not in ("ban", "kick"): - # Accordingly display whether the user was successfully notified via DM. + dm_result = f"{constants.Emojis.failmail} " + dm_log_text = "\nDM: **Failed**" + + # Accordingly update whether the user was successfully notified via DM. if await _utils.notify_infraction(user, infr_type.replace("_", " ").title(), expiry, user_reason, icon): dm_result = ":incoming_envelope: " dm_log_text = "\nDM: Sent" - else: - dm_result = f"{constants.Emojis.failmail} " - dm_log_text = "\nDM: **Failed**" # Send a confirmation message to the invoking context. log.trace(f"Sending infraction #{id_} confirmation message.") |