feat: re-added disabling buttons to the update command's no option

This commit is contained in:
Seaswimmer 2023-07-15 23:10:42 -04:00
parent 09b7a4a6ab
commit 4fab6745e2
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -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: async with session.get(await Pterodactyl.get_url(interaction.guild, "resources"), headers=self.passed_info['headers']) as response:
response_dict = await response.json() response_dict = await response.json()
if response_dict['attributes']['current_state'] == "offline": 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 break
else: else:
await asyncio.sleep(2) await asyncio.sleep(2)
@ -165,7 +165,9 @@ class Pterodactyl(commands.Cog):
@ui.button(label="No", style=discord.ButtonStyle.danger) @ui.button(label="No", style=discord.ButtonStyle.danger)
async def no_button(self, button:ui.Button, interaction:discord.Interaction): 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) await message.delete(delay=5)
@app_commands.command() @app_commands.command()