diff --git a/moderation/moderation.py b/moderation/moderation.py index 0f128d1..eff3c43 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -74,8 +74,11 @@ class Moderation(commands.Cog): elif entry.action == discord.AuditLogAction.unban: moderation_type = 'UNBAN' elif entry.action == discord.AuditLogAction.member_update: - duration = entry.after.timed_out_until - moderation_type = 'TIMEOUT' + if entry.after.timed_out_until is not None: + duration = entry.after.timed_out_until + moderation_type = 'TIMEOUT' + else: + moderation_type = 'UNTIMEOUT' else: return await self.mysql_log(entry.guild.id, entry.user.id, moderation_type, entry.target.id, duration, reason)