diff --git a/moderation/moderation.py b/moderation/moderation.py index 6502943..e09e197 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -1,4 +1,4 @@ -from datetime import datetime +from datetime import datetime, timedelta import logging import time import discord @@ -75,7 +75,9 @@ class Moderation(commands.Cog): moderation_type = 'UNBAN' elif entry.action == discord.AuditLogAction.member_update: if entry.after.timed_out_until is not None: - duration = entry.after.timed_out_until + duration_datetime = datetime.now() - entry.after.timed_out_until + minutes = round(duration_datetime.total_seconds() / 60) + duration = timedelta(minutes=minutes) moderation_type = 'TIMEOUT' else: moderation_type = 'UNTIMEOUT'