fix(aurora): fixed override embed erroring

This commit is contained in:
Seaswimmer 2024-01-16 10:33:25 +00:00
parent 7ae16ea258
commit 98a2c463b9
Signed by untrusted user: cswimr
GPG key ID: D74DDDDF420E13DF

View file

@ -22,28 +22,28 @@ class Overrides(ui.View):
await config.user(self.ctx.author).auto_evidenceformat.set(select.values[0]) await config.user(self.ctx.author).auto_evidenceformat.set(select.values[0])
await interaction.message.edit(embed=await embed(self.ctx)) await interaction.message.edit(embed=await embed(self.ctx))
@ui.button(label="Ephemeral (U)", style=ButtonStyle.green, row=0) @ui.select(cls=ui.Select, placeholder="Epheremal", row=1, options=[
async def ephemeral(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument 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() await interaction.response.defer()
if self.ctx.author != interaction.user: if self.ctx.author != interaction.user:
await interaction.followup.send("You cannot change this setting for other users.", ephemeral=True) await interaction.followup.send("You cannot change this setting for other users.", ephemeral=True)
return return
current_setting = await config.user(self.ctx.author).history_ephemeral() await config.user(self.ctx.author).history_ephemeral.set(select.values[0])
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 interaction.message.edit(embed=await embed(self.ctx)) 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 async def inline(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
await interaction.response.defer() await interaction.response.defer()
if self.ctx.author != interaction.user: if self.ctx.author != interaction.user:
await interaction.followup.send("You cannot change this setting for other users.", ephemeral=True) await interaction.followup.send("You cannot change this setting for other users.", ephemeral=True)
return return
current_setting = await config.user(self.ctx.author).history_inline() await config.user(self.ctx.author).history_inline.set(button.values[0])
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 interaction.message.edit(embed=await embed(self.ctx)) await interaction.message.edit(embed=await embed(self.ctx))