fix(pterodactyl): testing a fix to tellraw
Some checks failed
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 18s
Actions / Build Documentation (MkDocs) (pull_request) Successful in 21s

This commit is contained in:
Seaswimmer 2024-02-29 21:46:47 -05:00
parent 07835e7b13
commit ef7f574306
Signed by: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -28,7 +28,7 @@ class Pterodactyl(commands.Cog):
startup_arguments=None, startup_arguments=None,
power_action_in_progress=False, power_action_in_progress=False,
chat_regex=r"\[(\d{2}:\d{2}:\d{2})\sINFO\]:\s<(\w+)>\s(.*)", chat_regex=r"\[(\d{2}:\d{2}:\d{2})\sINFO\]:\s<(\w+)>\s(.*)",
tellraw_json='tellraw @a ["",{{"text":".$U ","color":".$C"}},{{"text":" (DISCORD): ","color":"blue"}},{{"text":".$M","color":"white"}}]', tellraw_json='tellraw @a ["",{"text":".$U ","color":".$C"},{"text":" (DISCORD): ","color":"blue"},{"text":".$M","color":"white"}]',
api_endpoint="minecraft", api_endpoint="minecraft",
chat_channel=None chat_channel=None
) )
@ -107,7 +107,7 @@ class Pterodactyl(commands.Cog):
console = self.bot.get_channel(await self.config.console_channel()) console = self.bot.get_channel(await self.config.console_channel())
if console is not None: if console is not None:
await console.send(f"Server status changed! `{json.loads(message)['args'][0]}`") await console.send(f"Server status changed! `{json.loads(message)['args'][0]}`")
except websockets.exceptions.ConnectionClosed as e: except (websockets.exceptions.ConnectionClosed) as e:
self.logger.info("WebSocket connection closed: %s", e) self.logger.info("WebSocket connection closed: %s", e)
websocket_credentials = client.servers.get_websocket(server_id) websocket_credentials = client.servers.get_websocket(server_id)
continue continue