Compare commits

...

2 commits

Author SHA1 Message Date
4795fac5ac
fix(aurora): use elif instead of if
All checks were successful
Actions / Lint Code (Pylint) (pull_request) Successful in 16s
Actions / Build Documentation (MkDocs) (pull_request) Successful in 12s
2024-01-16 11:20:21 +00:00
d20cb4c3bc
fix(aurora): fixed resetting pagesize 2024-01-16 11:18:05 +00:00

View file

@ -19,7 +19,7 @@ class Overrides(ui.View):
current_setting = await config.user(self.ctx.author).auto_evidenceformat()
if current_setting is False:
await config.user(self.ctx.author).auto_evidenceformat.clear()
if current_setting is None:
elif current_setting is None:
await config.user(self.ctx.author).auto_evidenceformat.set(True)
else:
await config.user(self.ctx.author).auto_evidenceformat.set(False)
@ -34,7 +34,7 @@ class Overrides(ui.View):
current_setting = await config.user(self.ctx.author).history_ephemeral()
if current_setting is False:
await config.user(self.ctx.author).history_ephemeral.clear()
if current_setting is None:
elif current_setting is None:
await config.user(self.ctx.author).history_ephemeral.set(True)
else:
await config.user(self.ctx.author).history_ephemeral.set(False)
@ -49,7 +49,7 @@ class Overrides(ui.View):
current_setting = await config.user(self.ctx.author).history_inline()
if current_setting is False:
await config.user(self.ctx.author).history_inline.clear()
if current_setting is None:
elif current_setting is None:
await config.user(self.ctx.author).history_inline.set(True)
else:
await config.user(self.ctx.author).history_inline.set(False)
@ -61,7 +61,10 @@ class Overrides(ui.View):
await interaction.response.send_message("You cannot change this setting for other users.", ephemeral=True)
return
await interaction.response.defer()
await config.user(self.ctx.author).history_inline_pagesize.set(int(select.values[0]))
if select.values[0] == "default":
await config.user(self.ctx.author).history_inline_pagesize.clear()
else:
await config.user(self.ctx.author).history_inline_pagesize.set(int(select.values[0]))
await interaction.message.edit(embed=await embed(self.ctx))
@ui.select(placeholder="Pagesize", options=create_pagesize_options(), row=2)
@ -70,5 +73,8 @@ class Overrides(ui.View):
await interaction.response.send_message("You cannot change this setting for other users.", ephemeral=True)
return
await interaction.response.defer()
await config.user(self.ctx.author).history_pagesize.set(int(select.values[0]))
if select.values[0] == "default":
await config.user(self.ctx.author).history_pagesize.clear()
else:
await config.user(self.ctx.author).history_pagesize.set(int(select.values[0]))
await interaction.message.edit(embed=await embed(self.ctx))