forked from blizzthewolf/SeaCogs
fix(aurora): fixed override embed erroring
This commit is contained in:
parent
7ae16ea258
commit
98a2c463b9
1 changed files with 13 additions and 13 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue