diff --git a/moderation/moderation.py b/moderation/moderation.py index 0c952e6..3d7defe 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -1326,20 +1326,23 @@ class Moderation(commands.Cog): @checks.admin() async def moderationset_import_galacticbot(self, ctx: commands.Context): """Import moderations from GalacticBot. **UNFINISHED!**""" - await ctx.send("Are you sure you want to import GalacticBot moderations? This will overwrite any moderations that already exist in the database.", view=self.GalacticBotImportButtons(60)) + message = await ctx.send("Are you sure you want to import GalacticBot moderations? This will overwrite any moderations that already exist in the database.") + await message.edit(view=self.GalacticBotImportButtons(60, message)) class GalacticBotImportButtons(discord.ui.View): - def __init__(self, timeout): + def __init__(self, timeout, message): super().__init__() + self.message: discord.Message = message self.config = Config.get_conf(None, cog_name='Moderation', identifier=481923957134912) @discord.ui.button(label="Yes", style=discord.ButtonStyle.success) async def import_button_y(self, interaction: discord.Interaction, button: discord.ui.Button): # pylint: disable=unused-argument - await interaction.response.send_modal(Moderation.MySQLConfigModal(self.config)) + await self.message.edit("This command does nothing at the moment.", view=None) @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 - await interaction.response.send_modal(Moderation.MySQLConfigModal(self.config)) + await self.message.edit("Import cancelled.", view=None) + await self.message.delete(10) @commands.command(aliases=["tdc"]) async def timedeltaconvert(self, ctx: commands.Context, *, duration: str):