From 6c73df59dab79d0ba788661fcfcacc14931d3429 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Sun, 16 Jul 2023 08:19:55 -0400 Subject: [PATCH] fix: hopefully fixed message editing --- pterodactyl/ptero.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pterodactyl/ptero.py b/pterodactyl/ptero.py index 16ae4a3..9f9a1d1 100644 --- a/pterodactyl/ptero.py +++ b/pterodactyl/ptero.py @@ -124,13 +124,13 @@ class Pterodactyl(commands.Cog): @ui.button(label="Yes", style=discord.ButtonStyle.success) async def yes_button(self, button:ui.Button, interaction:discord.Interaction): requests.post(await Pterodactyl.get_url(self, self.passed_info['guild'], "power"), headers=self.passed_info['headers'], json={"signal": "stop"}) - await self.passed_info['interaction'].edit_original_response("Server stopping...", view=None) + await self.passed_info['interaction'].edit_original_response(content="Server stopping...", view=None) while True: async with aiohttp.ClientSession() as session: async with session.get(await Pterodactyl.get_url(self, interaction.guild, "resources"), headers=self.passed_info['headers']) as response: response_dict = await response.json() if response_dict['attributes']['current_state'] == "offline": - await self.passed_info['interaction'].edit_original_response("\nServer stopped!") + await self.passed_info['interaction'].edit_original_response(content="\nServer stopped!") break else: await asyncio.sleep(2) @@ -138,14 +138,14 @@ class Pterodactyl(commands.Cog): for data in self.passed_info['updater_startup_vars']: await Pterodactyl.put(await Pterodactyl.get_url(self, interaction.guild, "startup/variable"), self.passed_info['headers'], data) requests.post(await Pterodactyl.get_url(self, interaction.guild, "power"), headers=self.passed_info['headers'], json={"signal": "start"}) - await self.passed_info['interaction'].edit_original_response("Packwiz installer started...") + await self.passed_info['interaction'].edit_original_response(content="Packwiz installer started...") await asyncio.sleep(1) while True: async with aiohttp.ClientSession() as session: async with session.get(await Pterodactyl.get_url(self, interaction.guild, "resources"), headers=self.passed_info['headers']) as response: response_dict = await response.json() if response_dict['attributes']['current_state'] == "offline": - await self.passed_info['interaction'].edit_original_response("Packwiz installer finished!") + await self.passed_info['interaction'].edit_original_response(content="Packwiz installer finished!") break else: await asyncio.sleep(1) @@ -154,13 +154,13 @@ class Pterodactyl(commands.Cog): await Pterodactyl.put(Pterodactyl.get_url(self, interaction.guild, "startup/variable"), self.passed_info['headers'], data) asyncio.sleep(1) requests.post(await Pterodactyl.get_url(self, interaction.guild, "power"), self.passed_info['headers'], json={"signal": "start"}) - await self.passed_info['interaction'].edit_original_response("Server starting...") + await self.passed_info['interaction'].edit_original_response(content="Server starting...") while True: async with aiohttp.ClientSession() as session: async with session.get(await Pterodactyl.get_url(self, interaction.guild, "resources"), headers=self.passed_info['headers']) as response: response_dict = await response.json() if response_dict['attributes']['current_state'] == "running": - await self.passed_info['interaction'].edit_original_response("Server started!\nUpdate process completed!") + await self.passed_info['interaction'].edit_original_response(content="Server started!\nUpdate process completed!") break else: await asyncio.sleep(1)