This commit is contained in:
parent
f298567224
commit
189a6f82ab
1 changed files with 3 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta, timezone
|
||||
import logging
|
||||
import time
|
||||
import discord
|
||||
|
@ -75,7 +75,8 @@ class Moderation(commands.Cog):
|
|||
moderation_type = 'UNBAN'
|
||||
elif entry.action == discord.AuditLogAction.member_update:
|
||||
if entry.after.timed_out_until is not None:
|
||||
duration_datetime = datetime.now() - entry.after.timed_out_until
|
||||
timed_out_until_aware = entry.after.timed_out_until.replace(tzinfo=timezone.utc)
|
||||
duration_datetime = datetime.now(tz=timezone.utc) - timed_out_until_aware
|
||||
minutes = round(duration_datetime.total_seconds() / 60)
|
||||
duration = timedelta(minutes=minutes)
|
||||
moderation_type = 'TIMEOUT'
|
||||
|
|
Loading…
Reference in a new issue