changed how modal works

This commit is contained in:
Seaswimmer 2023-07-14 12:09:17 -04:00
parent ad8f8a65e8
commit c99416ede5
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -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)