changed how the modal response works
This commit is contained in:
parent
30e989c91e
commit
30483a44b8
1 changed files with 8 additions and 4 deletions
|
@ -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)
|
||||||
|
|
Reference in a new issue