changed how modal works
This commit is contained in:
parent
ad8f8a65e8
commit
c99416ede5
1 changed files with 41 additions and 41 deletions
|
@ -42,7 +42,7 @@ class Pterodactyl(commands.Cog):
|
|||
@app_commands.command()
|
||||
async def config(self, interaction: discord.Interaction):
|
||||
"""Configures the Pterodactyl cog."""
|
||||
await interaction.response.send_modal(self.ConfigModal(interaction.guild))
|
||||
await interaction.response.send_modal(ConfigModal(interaction.guild))
|
||||
|
||||
class ConfigModal(discord.ui.Modal, title="Pterodactyl Manager Configuration"):
|
||||
def __init__(self, guild: discord.guild):
|
||||
|
@ -71,7 +71,7 @@ class Pterodactyl(commands.Cog):
|
|||
)
|
||||
|
||||
async def on_submit(self, interaction: discord.Interaction):
|
||||
config_list = [await Pterodactyl.config.guild(interaction.guild).base_url(), await Pterodactyl.config.guild(interaction.guild).api_key(), await Pterodactyl.config.guild(interaction.guild).server_id()]
|
||||
config_list = [await Pterodactyl.config.guild(self.guild).base_url(), await Pterodactyl.config.guild(self.guild).api_key(), await Pterodactyl.config.guild(self.guild).server_id()]
|
||||
message = ""
|
||||
if self.base_url.value != "":
|
||||
config_list[0].set(self.base_url)
|
||||
|
|
Reference in a new issue