forked from cswimr/SeaCogs
fix(aurora): fixed bad request
This commit is contained in:
parent
98a2c463b9
commit
a43f3de8bc
2 changed files with 17 additions and 11 deletions
|
@ -22,10 +22,7 @@ class Configuration(Mixin):
|
|||
@aurora_settings.command(name="user")
|
||||
async def aurora_settings_core(self, ctx: commands.Context):
|
||||
"""Manage Aurora's user overriddable settings."""
|
||||
if ctx.guild is not None and (ctx.author.guild_permissions.administrator or ctx.author.guild_permissions.manage_guild):
|
||||
view = None
|
||||
else:
|
||||
view = Overrides(ctx)
|
||||
view = Overrides(ctx)
|
||||
await ctx.send(embed=await embed(ctx), view=view)
|
||||
|
||||
@aurora_settings.command(name="addrole", aliases=["removerole"])
|
||||
|
|
|
@ -12,38 +12,47 @@ class Overrides(ui.View):
|
|||
@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="Default", value=None, emoji="🔁")
|
||||
SelectOption(label="Default", value='None', emoji="🔁")
|
||||
])
|
||||
async def auto_evidenceformat(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
|
||||
await config.user(self.ctx.author).auto_evidenceformat.set(select.values[0])
|
||||
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 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="Default", value=None, 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
|
||||
await config.user(self.ctx.author).history_ephemeral.set(select.values[0])
|
||||
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 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="Default", value=None, 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, 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
|
||||
await config.user(self.ctx.author).history_inline.set(button.values[0])
|
||||
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 interaction.message.edit(embed=await embed(self.ctx))
|
||||
|
|
Loading…
Reference in a new issue