misc(pterodactyl): removed credentials from default configs

api key has been invalidated
This commit is contained in:
Seaswimmer 2024-02-27 23:18:17 -05:00
parent 6158d05960
commit dcf0165a8a
Signed by untrusted user: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -12,11 +12,11 @@ class Pterodactyl(commands.Cog):
def __init__(self, bot: Red):
self.bot = bot
self.config = Config.get_conf(self, identifier=457581387213637448123567)
self.config = Config.get_conf(self, identifier=457581387213637448123567, force_registration=True)
self.config.register_global(
base_url='https://mc.bloom.host',
api_key='ptlc_G1leFiGsBXeo4lkRasXOMUJhE1aXnygQmg2AKgLKNjk',
server_id='5756a968',
base_url=None,
api_key=None,
server_id=None,
startup_jar=None,
startup_arguments=None,
power_action_in_progress=False
@ -40,7 +40,7 @@ class Pterodactyl(commands.Cog):
self.logger.debug("WebSocket connection established")
# Send authentication token
auth_message = json.dumps({"event": "auth", "args": websocket_credentials['data']['token']})
auth_message = json.dumps({"event": "auth", "args": [websocket_credentials['data']['token']]})
await websocket.send(auth_message)
self.logger.debug("Authentication message sent")
@ -49,6 +49,9 @@ class Pterodactyl(commands.Cog):
while True:
message = await websocket.recv()
if json.loads(message)['event'] == 'token expiring':
websocket_credentials = client.servers.get_websocket(server_id)
auth_message = json.dumps({"event": "auth", "args": [websocket_credentials['data']['token']]})
self.logger.debug("Received message: %s", message)
async def cog_load(self):