forked from cswimr/SeaCogs
fix(pterodactyl): fixed current_status
This commit is contained in:
parent
39ae8b5ea0
commit
239f7cf613
1 changed files with 2 additions and 2 deletions
|
@ -62,10 +62,10 @@ class Pterodactyl(commands.Cog):
|
|||
self.logger.debug("Authentication message sent")
|
||||
|
||||
self.websocket = websocket
|
||||
current_status = ''
|
||||
|
||||
while True:
|
||||
message = await websocket.recv()
|
||||
current_status = ''
|
||||
if json.loads(message)['event'] in ['token expiring', 'token expired']:
|
||||
self.logger.debug("Received token expiring/expired event. Refreshing token.")
|
||||
websocket_credentials = client.servers.get_websocket(server_id)
|
||||
|
@ -77,7 +77,7 @@ class Pterodactyl(commands.Cog):
|
|||
self.logger.debug("Authentication successful")
|
||||
|
||||
if json.loads(message)['event'] == 'console output' and await self.config.console_channel() is not None:
|
||||
if current_status != 'starting' and current_status != 'stopping' and current_status != 'restarting':
|
||||
if current_status == 'started' or current_status == 'offline' or current_status == '':
|
||||
channel = self.bot.get_channel(await self.config.console_channel())
|
||||
if channel is not None:
|
||||
content = self.remove_ansi_escape_codes(json.loads(message)['args'][0][:1900])
|
||||
|
|
Loading…
Reference in a new issue