fix(moderation): added messages to the import buttons
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 53s

This commit is contained in:
Seaswimmer 2023-12-14 18:03:30 -05:00
parent 51d4dbb4cb
commit be11b12517
Signed by: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -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):