From 98a2c463b91ddadfbf6615cde3e1d8a098af1db3 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 16 Jan 2024 10:33:25 +0000 Subject: [PATCH] fix(aurora): fixed override embed erroring --- aurora/configuration/menus/overrides.py | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/aurora/configuration/menus/overrides.py b/aurora/configuration/menus/overrides.py index 15e822c..be1c41a 100644 --- a/aurora/configuration/menus/overrides.py +++ b/aurora/configuration/menus/overrides.py @@ -22,28 +22,28 @@ class Overrides(ui.View): await config.user(self.ctx.author).auto_evidenceformat.set(select.values[0]) await interaction.message.edit(embed=await embed(self.ctx)) - @ui.button(label="Ephemeral (U)", style=ButtonStyle.green, row=0) - async def ephemeral(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument + @ui.select(cls=ui.Select, placeholder="Epheremal", row=1, options=[ + SelectOption(label="Enabled", value=True, emoji="✅"), + SelectOption(label="Disabled", value=False, emoji="❌"), + SelectOption(label="Default", value=None, emoji="🔁") + ]) + async def ephemeral(self, interaction: Interaction, select: ui.Select): # pylint: disable=unused-argument await interaction.response.defer() if self.ctx.author != interaction.user: await interaction.followup.send("You cannot change this setting for other users.", ephemeral=True) return - current_setting = await config.user(self.ctx.author).history_ephemeral() - if current_setting: - await config.user(self.ctx.author).history_ephemeral.set(not current_setting) - else: - await config.user(self.ctx.author).history_ephemeral.set(True) + await config.user(self.ctx.author).history_ephemeral.set(select.values[0]) await interaction.message.edit(embed=await embed(self.ctx)) - @ui.button(label="Inline (U)", style=ButtonStyle.green, row=0) + @ui.select(cls=ui.Select, placeholder="Inline", row=2, options=[ + SelectOption(label="Enabled", value=True, emoji="✅"), + SelectOption(label="Disabled", value=False, emoji="❌"), + SelectOption(label="Default", value=None, emoji="🔁") + ]) async def inline(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument await interaction.response.defer() if self.ctx.author != interaction.user: await interaction.followup.send("You cannot change this setting for other users.", ephemeral=True) return - current_setting = await config.user(self.ctx.author).history_inline() - if current_setting: - await config.user(self.ctx.author).history_inline.set(not current_setting) - else: - await config.user(self.ctx.author).history_inline.set(True) + await config.user(self.ctx.author).history_inline.set(button.values[0]) await interaction.message.edit(embed=await embed(self.ctx))