trimmed the user-facing api key storage

This commit is contained in:
Seaswimmer 2023-07-15 13:14:17 -04:00
parent 46b64ab067
commit 0d0310c91c
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -198,15 +198,15 @@ class Pterodactyl(commands.Cog):
message = ""
if self.base_url.value != "":
await self.config.guild(interaction.guild).base_url.set(self.base_url.value)
message += f"Base URL set to `{self.base_url.value}`\n"
message += f"- Base URL set to `{self.base_url.value}`\n"
if self.api_key.value != "":
await self.config.guild(interaction.guild).api_key.set(self.api_key.value)
message += f"API Key set to `{self.api_key.value}`\n"
message += f"- API Key set to `{self.api_key.value}`\n"
if 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[:16]}`\n"
if message == "":
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()}`"
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()[:16]}`\n- Server ID: `{await self.config.guild(interaction.guild).server_id()}`"
else:
send = f"Configuration changed:\n{message}"
await interaction.response.send_message(send, ephemeral=True)