From 9d4d8b8267405cde4c38d86906f32f7dc922a56a Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Wed, 28 Feb 2024 08:11:15 -0500 Subject: [PATCH] misc(pterodactyl): moved configuration calls into establish_websocket_connection --- pterodactyl/pterodactyl.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pterodactyl/pterodactyl.py b/pterodactyl/pterodactyl.py index c279715..8492f84 100644 --- a/pterodactyl/pterodactyl.py +++ b/pterodactyl/pterodactyl.py @@ -25,7 +25,10 @@ class Pterodactyl(commands.Cog): self.client = None self.websocket = None - async def establish_websocket_connection(self, base_url, api_key, server_id): + async def establish_websocket_connection(self): + base_url = await self.config.base_url() + api_key = await self.config.api_key() + server_id = await self.config.server_id() try: client = PterodactylClient(base_url, api_key).client websocket_credentials = client.servers.get_websocket(server_id) @@ -61,10 +64,7 @@ class Pterodactyl(commands.Cog): self.logger.debug("Received message: %s", message) async def cog_load(self): - base_url = await self.config.base_url() - api_key = await self.config.api_key() - server_id = await self.config.server_id() - await self.establish_websocket_connection(base_url, api_key, server_id) + await self.establish_websocket_connection() async def cog_unload(self): await self.client._session.close()