fix(aurora): fixed setting overrides not working
Some checks failed
Actions / Lint Code (Pylint) (pull_request) Failing after 14s
Actions / Build Documentation (MkDocs) (pull_request) Successful in 11s

This commit is contained in:
Seaswimmer 2024-01-16 10:39:00 +00:00
parent a43f3de8bc
commit 219b18e34b
Signed by: cswimr
GPG key ID: D74DDDDF420E13DF

View file

@ -10,8 +10,8 @@ class Overrides(ui.View):
self.ctx = ctx
@ui.select(cls=ui.Select, placeholder="Auto Evidence Format", row=0, options=[
SelectOption(label="Enabled", value=True, emoji=""),
SelectOption(label="Disabled", value=False, emoji=""),
SelectOption(label="Enabled", value=1, emoji=""),
SelectOption(label="Disabled", value=0, emoji=""),
SelectOption(label="Default", value='None', emoji="🔁")
])
async def auto_evidenceformat(self, interaction: Interaction, select: ui.Select): # pylint: disable=unused-argument
@ -22,12 +22,12 @@ class Overrides(ui.View):
if select.values[0] == 'None':
await config.user(self.ctx.author).auto_evidenceformat.clear()
else:
await config.user(self.ctx.author).auto_evidenceformat.set(select.values[0])
await config.user(self.ctx.author).auto_evidenceformat.set(bool(select.values[0]))
await interaction.message.edit(embed=await embed(self.ctx))
@ui.select(cls=ui.Select, placeholder="Epheremal", row=1, options=[
SelectOption(label="Enabled", value=True, emoji=""),
SelectOption(label="Disabled", value=False, emoji=""),
SelectOption(label="Enabled", value=1, emoji=""),
SelectOption(label="Disabled", value=0, emoji=""),
SelectOption(label="Default", value='None', emoji="🔁")
])
async def ephemeral(self, interaction: Interaction, select: ui.Select): # pylint: disable=unused-argument
@ -38,12 +38,12 @@ class Overrides(ui.View):
if select.values[0] == 'None':
await config.user(self.ctx.author).history_ephemeral.clear()
else:
await config.user(self.ctx.author).history_ephemeral.set(select.values[0])
await config.user(self.ctx.author).history_ephemeral.set(bool(select.values[0]))
await interaction.message.edit(embed=await embed(self.ctx))
@ui.select(cls=ui.Select, placeholder="Inline", row=2, options=[
SelectOption(label="Enabled", value=True, emoji=""),
SelectOption(label="Disabled", value=False, emoji=""),
SelectOption(label="Enabled", value=1, emoji=""),
SelectOption(label="Disabled", value=0, emoji=""),
SelectOption(label="Default", value='None', emoji="🔁")
])
async def inline(self, interaction: Interaction, select: ui.Select): # pylint: disable=unused-argument
@ -54,5 +54,5 @@ class Overrides(ui.View):
if select.values[0] == 'None':
await config.user(self.ctx.author).history_inline.clear()
else:
await config.user(self.ctx.author).history_inline.set(select.values[0])
await config.user(self.ctx.author).history_inline.set(bool(select.values[0]))
await interaction.message.edit(embed=await embed(self.ctx))