diff --git a/moderation/moderation.py b/moderation/moderation.py index c9ef28b..47cc7b2 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -1739,7 +1739,7 @@ class Moderation(commands.Cog): file = await self.ctx.message.attachments[0].read() data = sorted(json.loads(file), key=lambda x: x['case']) - async def process_case(case, accepted_types): + async def process_case(case, accepted_types, interaction: discord.Interaction): for case in data: if case['type'] not in accepted_types: continue @@ -1794,7 +1794,10 @@ class Moderation(commands.Cog): await interaction.edit_original_response(content="Import complete.") - await asyncio.gather(*[process_case(case, accepted_types) for case in data]) + async def process_cases(data, accepted_types, interaction): + await asyncio.gather(*[process_case(case, accepted_types, interaction) for case in data]) + + await process_cases(data, accepted_types, interaction) @discord.ui.button(label="No", style=discord.ButtonStyle.danger) async def import_button_n(self, interaction: discord.Interaction, button: discord.ui.Button): # pylint: disable=unused-argument