fix(pterodactyl): make sure views get removed properly

This commit is contained in:
Seaswimmer 2024-03-05 02:19:59 -05:00
parent df92bc34cc
commit 80cb729e72
Signed by untrusted user: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -128,7 +128,7 @@ class Pterodactyl(commands.Cog):
if view.result is True:
await message.edit(content="Sending websocket command to start server...", view=None)
await self.websocket.send(json.dumps({"event": "set state", "args": ["start"]}))
await message.edit(content="Server starting...")
await message.edit(content="Server starting...", view=None)
else:
await message.edit(content="Cancelled.", view=None)
@ -146,7 +146,7 @@ class Pterodactyl(commands.Cog):
if view.result is True:
await message.edit(content="Sending websocket command to stop server...", view=None)
await self.websocket.send(json.dumps({"event": "set state", "args": ["stop"]}))
await message.edit(content="Server stopping...")
await message.edit(content="Server stopping...", view=None)
else:
await message.edit(content="Cancelled.", view=None)
@ -162,7 +162,7 @@ class Pterodactyl(commands.Cog):
if view.result is True:
await message.edit(content="Sending websocket command to restart server...", view=None)
await self.websocket.send(json.dumps({"event": "set state", "args": ["restart"]}))
await message.edit(content="Server restarting...")
await message.edit(content="Server restarting...", view=None)
else:
await message.edit(content="Cancelled.", view=None)