fix(moderation): fixed moderation imports
This commit is contained in:
parent
7c3310af32
commit
e2c165297d
1 changed files with 9 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
from datetime import timedelta
|
||||
from datetime import timedelta, strptime
|
||||
import json
|
||||
from redbot.core import commands
|
||||
from discord import Message, ButtonStyle, Interaction, ui
|
||||
|
@ -69,6 +69,13 @@ class ImportModerationView(ui.View):
|
|||
if 'metadata' not in case or not case['metadata']:
|
||||
case['metadata'] = {}
|
||||
|
||||
duration_t = strptime(case['duration'], "%H:%M:%S")
|
||||
duration = timedelta(
|
||||
hours=duration_t.hours,
|
||||
minutes=duration_t.minutes,
|
||||
seconds=duration_t.seconds
|
||||
)
|
||||
|
||||
await mysql_log(
|
||||
self.ctx.guild.id,
|
||||
case['moderator_id'],
|
||||
|
@ -76,7 +83,7 @@ class ImportModerationView(ui.View):
|
|||
case['target_type'],
|
||||
case['target_id'],
|
||||
case['role_id'],
|
||||
case['duration'],
|
||||
duration,
|
||||
case['reason'],
|
||||
timestamp=case['timestamp'],
|
||||
resolved=case['resolved'],
|
||||
|
|
Loading…
Reference in a new issue