diff --git a/moderation/importers/moderation.py b/moderation/importers/moderation.py index 7c02126..5292130 100644 --- a/moderation/importers/moderation.py +++ b/moderation/importers/moderation.py @@ -31,7 +31,7 @@ class ImportModerationView(ui.View): await interaction.edit_original_response(content="Importing moderations...") file = await self.ctx.message.attachments[0].read() - data = sorted(json.loads(file), key=lambda x: x['moderation_id']) + data: [dict] = sorted(json.loads(file), key=lambda x: x['moderation_id']) user_mod_types = [ 'NOTE', @@ -51,6 +51,9 @@ class ImportModerationView(ui.View): failed_cases = [] for case in data: + if case['moderation_id'] == 0: + continue + if 'target_type' not in case or not case['target_type']: if case['moderation_type'] in user_mod_types: case['target_type'] = 'USER'