Compare commits

...

3 commits

View file

@ -50,7 +50,6 @@ class Pterodactyl(commands.Cog):
async with session.put(url, headers=headers, json=data) as response: async with session.put(url, headers=headers, json=data) as response:
return response return response
@app_commands.command(name="update", description="Updates the server.") @app_commands.command(name="update", description="Updates the server.")
@app_commands.guild_only() @app_commands.guild_only()
async def update(self, interaction: discord.Interaction): async def update(self, interaction: discord.Interaction):
@ -67,7 +66,6 @@ class Pterodactyl(commands.Cog):
await interaction_message.edit(f"Something went wrong.\nError: `Startup arguments not set.`", ephemeral=True) await interaction_message.edit(f"Something went wrong.\nError: `Startup arguments not set.`", ephemeral=True)
raise LookupError("Startup arguments not set.") raise LookupError("Startup arguments not set.")
else: else:
api_key = await self.config.guild(interaction.guild).api_key()
startup_jar = await self.config.guild(interaction.guild).startup_jar() startup_jar = await self.config.guild(interaction.guild).startup_jar()
startup_commands = await self.config.guild(interaction.guild).startup_arguments() startup_commands = await self.config.guild(interaction.guild).startup_arguments()
headers = await self.get_headers(interaction.guild) headers = await self.get_headers(interaction.guild)
@ -113,7 +111,7 @@ class Pterodactyl(commands.Cog):
continue continue
for data in old_startup_vars: for data in old_startup_vars:
await self.put(await self.get_url(interaction.guild, "startup/variable"), headers, data) await self.put(await self.get_url(interaction.guild, "startup/variable"), headers, data)
await interaction_message.edit(content="Packwiz installer finished.\nUpdate process completed!") await interaction_message.edit(content="Updater finished.\nUpdate process completed!")
elif response_dict['attributes']['current_state'] == "running" or response_dict['attributes']['current_state'] == "starting": elif response_dict['attributes']['current_state'] == "running" or response_dict['attributes']['current_state'] == "starting":
passed_info = { passed_info = {
"headers": headers, "headers": headers,