fix(pterodactyl): fixed some bugs
Some checks failed
Actions / Lint Code (Ruff & Pylint) (push) Failing after 19s
Actions / Build Documentation (MkDocs) (push) Successful in 22s

This commit is contained in:
Seaswimmer 2024-03-05 02:18:11 -05:00
parent b2f27f9490
commit df92bc34cc
Signed by: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -126,11 +126,11 @@ class Pterodactyl(commands.Cog):
message = await ctx.send("Are you sure you want to start the server?", view=view)
await view.wait()
if view.result is True:
await ctx.message("Sending websocket command to start server...")
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...")
else:
await message.edit(content="Cancelled.")
await message.edit(content="Cancelled.", view=None)
@pterodactyl_power.command(name = "stop")
async def pterodactyl_power_stop(self, ctx: commands.Context) -> None:
@ -144,11 +144,11 @@ class Pterodactyl(commands.Cog):
message = await ctx.send("Are you sure you want to stop the server?", view=view)
await view.wait()
if view.result is True:
await message.edit("Sending websocket command to stop server...")
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...")
else:
await message.edit(content="Cancelled.")
await message.edit(content="Cancelled.", view=None)
@pterodactyl_power.command(name = "restart")
async def pterodactyl_power_restart(self, ctx: commands.Context) -> None:
@ -160,11 +160,11 @@ class Pterodactyl(commands.Cog):
message = await ctx.send("Are you sure you want to restart the server?", view=view)
await view.wait()
if view.result is True:
await message.edit("Sending websocket command to restart server...")
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...")
else:
await message.edit(content="Cancelled.")
await message.edit(content="Cancelled.", view=None)
@pterodactyl.group(autohelp = True, name = "config", aliases = ["settings", "set"])
@commands.is_owner()