From 4fab6745e2a73d8abc907b0fa54edc50b49b36a6 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Sat, 15 Jul 2023 23:10:42 -0400 Subject: [PATCH] feat: re-added disabling buttons to the update command's no option --- pterodactyl/ptero.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pterodactyl/ptero.py b/pterodactyl/ptero.py index c220e89..ba1ddd0 100644 --- a/pterodactyl/ptero.py +++ b/pterodactyl/ptero.py @@ -127,7 +127,7 @@ class Pterodactyl(commands.Cog): async with session.get(await Pterodactyl.get_url(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("Server stopped!") + await self.passed_info['interaction'].edit_original_response("\nServer stopped!") break else: await asyncio.sleep(2) @@ -165,7 +165,9 @@ class Pterodactyl(commands.Cog): @ui.button(label="No", style=discord.ButtonStyle.danger) async def no_button(self, button:ui.Button, interaction:discord.Interaction): - message = await self.passed_info['interaction'].edit_original_response(content=f"Command cancelled.", view=None) + for button in self.children: + button.disabled = True + message = await self.passed_info['interaction'].edit_original_response(content=f"Command cancelled.", view=self) await message.delete(delay=5) @app_commands.command()