aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2022-01-02 21:38:23 +0000
committerGravatar GitHub <[email protected]>2022-01-02 21:38:23 +0000
commit73c08646d29e587959ff794678eed4cdf5976ddb (patch)
tree111f982bf33b3f4a043af3a1cd27291281f988a8
parentAdd text indicating when user fetched by message (#2013) (diff)
parentInfraction mod-log improvements (diff)
Merge pull request #2036 from python-discord/fix-bot-2034
Infraction mod-log improvements
-rw-r--r--bot/exts/moderation/infraction/_scheduler.py4
-rw-r--r--bot/exts/moderation/infraction/management.py5
2 files changed, 5 insertions, 4 deletions
diff --git a/bot/exts/moderation/infraction/_scheduler.py b/bot/exts/moderation/infraction/_scheduler.py
index 6f379a9a0..57aa2d9b6 100644
--- a/bot/exts/moderation/infraction/_scheduler.py
+++ b/bot/exts/moderation/infraction/_scheduler.py
@@ -223,7 +223,7 @@ class InfractionScheduler:
failed = True
if failed:
- log.trace(f"Deleted infraction {infraction['id']} from database because applying infraction failed.")
+ log.trace(f"Trying to delete infraction {id_} from database because applying infraction failed.")
try:
await self.bot.api_client.delete(f"bot/infractions/{id_}")
except ResponseCodeError as e:
@@ -265,7 +265,7 @@ class InfractionScheduler:
{additional_info}
"""),
content=log_content,
- footer=f"ID {infraction['id']}"
+ footer=f"ID: {id_}"
)
log.info(f"Applied {purge}{infr_type} infraction #{id_} to {user}.")
diff --git a/bot/exts/moderation/infraction/management.py b/bot/exts/moderation/infraction/management.py
index b77c20434..9649ff852 100644
--- a/bot/exts/moderation/infraction/management.py
+++ b/bot/exts/moderation/infraction/management.py
@@ -176,7 +176,7 @@ class ModManagement(commands.Cog):
if 'expires_at' in request_data:
# A scheduled task should only exist if the old infraction wasn't permanent
if infraction['expires_at']:
- self.infractions_cog.scheduler.cancel(new_infraction['id'])
+ self.infractions_cog.scheduler.cancel(infraction_id)
# If the infraction was not marked as permanent, schedule a new expiration task
if request_data['expires_at']:
@@ -210,7 +210,8 @@ class ModManagement(commands.Cog):
Member: {user_text}
Actor: <@{new_infraction['actor']}>
Edited by: {ctx.message.author.mention}{log_text}
- """)
+ """),
+ footer=f"ID: {infraction_id}"
)
# endregion