more changes woo

This commit is contained in:
Seaswimmer 2023-07-14 12:12:56 -04:00
parent 75eef36874
commit f678595016
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() @app_commands.command()
async def config(self, interaction: discord.Interaction): async def config(self, interaction: discord.Interaction):
"""Configures the Pterodactyl cog.""" """Configures the Pterodactyl cog."""
await interaction.response.send_modal(ConfigModal(interaction.guild)) await interaction.response.send_modal(self.ConfigModal(interaction.guild))
class ConfigModal(discord.ui.Modal, title="Pterodactyl Manager Configuration"): class ConfigModal(discord.ui.Modal, title="Pterodactyl Manager Configuration"):
def __init__(self, guild: discord.guild): def __init__(self, guild: discord.guild):
@ -71,7 +71,7 @@ class ConfigModal(discord.ui.Modal, title="Pterodactyl Manager Configuration"):
) )
async def on_submit(self, interaction: discord.Interaction): async def on_submit(self, interaction: discord.Interaction):
config_list = [await Pterodactyl.config.guild(ConfigModal.guild).base_url(), await Pterodactyl.config.guild(ConfigModal.guild).api_key(), await Pterodactyl.config.guild(ConfigModal.guild).server_id()] 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()]
message = "" message = ""
if self.base_url.value != "": if self.base_url.value != "":
config_list[0].set(self.base_url) config_list[0].set(self.base_url)