fix(moderation): fixed timeout logging
Some checks failed
Pylint / Pylint (push) Failing after 1m12s

This commit is contained in:
Seaswimmer 2023-10-04 12:01:54 -04:00
parent a036d5b898
commit a7bd24f783
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -74,8 +74,11 @@ class Moderation(commands.Cog):
elif entry.action == discord.AuditLogAction.unban: elif entry.action == discord.AuditLogAction.unban:
moderation_type = 'UNBAN' moderation_type = 'UNBAN'
elif entry.action == discord.AuditLogAction.member_update: elif entry.action == discord.AuditLogAction.member_update:
if entry.after.timed_out_until is not None:
duration = entry.after.timed_out_until duration = entry.after.timed_out_until
moderation_type = 'TIMEOUT' moderation_type = 'TIMEOUT'
else:
moderation_type = 'UNTIMEOUT'
else: else:
return return
await self.mysql_log(entry.guild.id, entry.user.id, moderation_type, entry.target.id, duration, reason) await self.mysql_log(entry.guild.id, entry.user.id, moderation_type, entry.target.id, duration, reason)