changed how the modal response works

This commit is contained in:
Seaswimmer 2023-07-15 13:04:03 -04:00
parent 30e989c91e
commit 30483a44b8
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -206,8 +206,10 @@ class Pterodactyl(commands.Cog):
await self.config.guild(interaction.guild).server_id.set(self.server_id.value) await self.config.guild(interaction.guild).server_id.set(self.server_id.value)
message += f"Server ID set to `{self.server_id.value}`.\n" message += f"Server ID set to `{self.server_id.value}`.\n"
if message == "": if message == "":
message = f"No changes were made.\nCurrent configuration:\n- Base URL: `{await self.config.guild(interaction.guild).base_url()}`\n- API Key: `{await self.config.guild(interaction.guild).api_key()}`\n- Server ID: `{await self.config.guild(interaction.guild).server_id()}`" send = f"No changes were made.\nCurrent configuration:\n- Base URL: `{await self.config.guild(interaction.guild).base_url()}`\n- API Key: `{await self.config.guild(interaction.guild).api_key()}`\n- Server ID: `{await self.config.guild(interaction.guild).server_id()}`"
await interaction.response.send_message(message, ephemeral=True) else:
send = f"Configuration changed:\n{message}"
await interaction.response.send_message(send, ephemeral=True)
class StartupConfigModal(discord.ui.Modal, title="Pterodactyl Manager Configuration"): class StartupConfigModal(discord.ui.Modal, title="Pterodactyl Manager Configuration"):
def __init__(self, config): def __init__(self, config):
@ -237,5 +239,7 @@ class Pterodactyl(commands.Cog):
await self.config.guild(interaction.guild).startup_arguments.set(self.startup_arguments.value) await self.config.guild(interaction.guild).startup_arguments.set(self.startup_arguments.value)
message += f"- Startup arguments set to:\n```{self.startup_arguments.value}```.\n" message += f"- Startup arguments set to:\n```{self.startup_arguments.value}```.\n"
if message == "": if message == "":
message = f"No changes were made.\nCurrent configuration:\n- Startup jar: `{await self.config.guild(interaction.guild).startup_jar()}`\n- Startup arguments:\n```{await self.config.guild(interaction.guild).startup_arguments()}```" send = f"No changes were made.\nCurrent configuration:\n- Startup jar: `{await self.config.guild(interaction.guild).startup_jar()}`\n- Startup arguments:\n```{await self.config.guild(interaction.guild).startup_arguments()}```"
await interaction.response.send_message(message, ephemeral=True) else:
send = f"Configuration changed:\n{message}"
await interaction.response.send_message(send, ephemeral=True)