aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-30 09:44:01 +0300
committerGravatar ks129 <[email protected]>2020-05-30 09:44:01 +0300
commit7f827abfa1922a4ec81d2f49fa2811471588269d (patch)
tree9d6b0bf63da5ee7989aef081ebfee5da112d0cb3
parentSimplify infraction reason truncation tests (diff)
Scheduler: Move inline f-string if-else statement to normal if statement
-rw-r--r--bot/cogs/moderation/scheduler.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/cogs/moderation/scheduler.py b/bot/cogs/moderation/scheduler.py
index b65048f4c..80a58484c 100644
--- a/bot/cogs/moderation/scheduler.py
+++ b/bot/cogs/moderation/scheduler.py
@@ -174,12 +174,15 @@ class InfractionScheduler(Scheduler):
dm_result = f"{constants.Emojis.failmail} "
log.trace(f"Deleted infraction {infraction['id']} from database because applying infraction failed.")
await self.bot.api_client.delete(f"bot/infractions/{infraction['id']}")
+ infr_message = ""
+ else:
+ infr_message = f"**{infr_type}** to {user.mention}{expiry_msg}{end_msg}"
# Send a confirmation message to the invoking context.
log.trace(f"Sending infraction #{id_} confirmation message.")
await ctx.send(
f"{dm_result}{confirm_msg} "
- f"{f'**{infr_type}** to {user.mention}{expiry_msg}{end_msg}' if not failed else ''}."
+ f"{infr_message}."
)
# Send a log message to the mod log.