aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar shtlrs <[email protected]>2023-12-09 16:37:38 +0100
committerGravatar shtlrs <[email protected]>2024-03-29 23:38:50 +0100
commita57cbef73dc1cc1562d911a2e83264f4efd8ed7b (patch)
tree01466b8b8592edda3d3293ded69a3ee335543595
parentallow timeout edits (diff)
do not edit discord timeout for users who left the server
if a user isn't a member of the server, trying to edit their timeout will result in an error
-rw-r--r--bot/exts/moderation/infraction/management.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/exts/moderation/infraction/management.py b/bot/exts/moderation/infraction/management.py
index 9fd851245..0a33c84ab 100644
--- a/bot/exts/moderation/infraction/management.py
+++ b/bot/exts/moderation/infraction/management.py
@@ -232,7 +232,7 @@ class ModManagement(commands.Cog):
if request_data["expires_at"]:
self.infractions_cog.schedule_expiration(new_infraction)
# Timeouts are handled by Discord itself, so we need to edit the expiry in Discord as well
- if infraction["type"] == "timeout":
+ if user and infraction["type"] == "timeout":
await user.edit(reason=reason, timed_out_until=expiry)
log_text += f"""