forked from cswimr/SeaCogs
fix(aurora): possibly fixed editing the config menu on settings change
This commit is contained in:
parent
a5b0055256
commit
a7f6cff625
1 changed files with 2 additions and 7 deletions
|
@ -11,18 +11,13 @@ class Overrides(ui.View):
|
||||||
|
|
||||||
@ui.button(label="Auto Evidence Format", style=ButtonStyle.green)
|
@ui.button(label="Auto Evidence Format", style=ButtonStyle.green)
|
||||||
async def auto_evidenceformat(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
async def auto_evidenceformat(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||||
await interaction.response.defer(ephemeral=True)
|
await interaction.response.defer()
|
||||||
current_setting = await config.user(self.ctx.author).auto_evidenceformat()
|
current_setting = await config.user(self.ctx.author).auto_evidenceformat()
|
||||||
if current_setting is not None:
|
if current_setting is not None:
|
||||||
await config.user(self.ctx.author).auto_evidenceformat.set(not current_setting)
|
await config.user(self.ctx.author).auto_evidenceformat.set(not current_setting)
|
||||||
else:
|
else:
|
||||||
await config.user(self.ctx.author).auto_evidenceformat.set(True)
|
await config.user(self.ctx.author).auto_evidenceformat.set(True)
|
||||||
if current_setting is True:
|
await interaction.message.edit(embed=await embed(self.ctx))
|
||||||
response = "Auto Evidence Format disabled."
|
|
||||||
else:
|
|
||||||
response = "Auto Evidence Format enabled."
|
|
||||||
await self.ctx.message.edit(embed=await embed(self.ctx))
|
|
||||||
await interaction.followup.send(content=response, ephemeral=True)
|
|
||||||
|
|
||||||
@ui.button(label="Ephemeral", style=ButtonStyle.green)
|
@ui.button(label="Ephemeral", style=ButtonStyle.green)
|
||||||
async def ephemeral(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
async def ephemeral(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||||
|
|
Loading…
Reference in a new issue