fix(pterodactyl): pylint fixes

This commit is contained in:
Seaswimmer 2024-02-28 11:08:16 -05:00
parent f485df856c
commit 8a22d5ce23
Signed by untrusted user: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -41,10 +41,10 @@ class Pterodactyl(commands.Cog):
websocket_credentials = client.servers.get_websocket(server_id) websocket_credentials = client.servers.get_websocket(server_id)
self.logger.debug("Websocket connection details retrieved:\nSocket: %s\nToken: %s", websocket_credentials['data']['socket'], websocket_credentials['data']['token']) self.logger.debug("Websocket connection details retrieved:\nSocket: %s\nToken: %s", websocket_credentials['data']['socket'], websocket_credentials['data']['token'])
except exceptions.ClientConfigError as e: except exceptions.ClientConfigError as e:
self.logger.error(f'Failed to initialize Pterodactyl client: {e}') self.logger.error('Failed to initialize Pterodactyl client: %s', e)
return return
except exceptions.PterodactylApiError as e: except exceptions.PterodactylApiError as e:
self.logger.error(f'Failed to retrieve Pterodactyl websocket: {e}') self.logger.error('Failed to retrieve Pterodactyl websocket: %s', e)
return return
async with websockets.connect(websocket_credentials['data']['socket'], extra_headers=extra_headers) as websocket: async with websockets.connect(websocket_credentials['data']['socket'], extra_headers=extra_headers) as websocket:
@ -76,18 +76,16 @@ class Pterodactyl(commands.Cog):
self.task = self.get_task() self.task = self.get_task()
async def cog_unload(self): async def cog_unload(self):
self.task.cancel() self.task.cancel()
await self.client._session.close() await self.client._session.close() # pylint: disable=protected-access
@commands.group(autohelp = True, name = "pterodactyl", aliases = ["ptero"]) @commands.group(autohelp = True, name = "pterodactyl", aliases = ["ptero"])
async def pterodactyl(self, ctx: commands.Context): async def pterodactyl(self, ctx: commands.Context):
"""Pterodactyl allows you to manage your Pterodactyl Panel from Discord.""" """Pterodactyl allows you to manage your Pterodactyl Panel from Discord."""
pass
@pterodactyl.group(autohelp = True, name = "config", aliases = ["settings", "set"]) @pterodactyl.group(autohelp = True, name = "config", aliases = ["settings", "set"])
async def pterodactyl_config(self, ctx: commands.Context): async def pterodactyl_config(self, ctx: commands.Context):
"""Configure Pterodactyl settings.""" """Configure Pterodactyl settings."""
pass
@pterodactyl_config.command(name = "url") @pterodactyl_config.command(name = "url")
async def pterodactyl_config_base_url(self, ctx: commands.Context, base_url: str): async def pterodactyl_config_base_url(self, ctx: commands.Context, base_url: str):