feat(repo): updated all cogs (except aurora) to use the help formatting present in the indev version of aurora

This commit is contained in:
cswimr 2024-08-27 14:22:19 -04:00
parent eb331faf55
commit 2c7b0f5441
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
7 changed files with 68 additions and 39 deletions

View file

@ -46,6 +46,23 @@ class Pterodactyl(commands.Cog):
]
return "\n".join(text)
async def cog_load(self) -> None:
pterodactyl_keys = await self.bot.get_shared_api_tokens("pterodactyl")
api_key = pterodactyl_keys.get("api_key")
if api_key is None:
self.task.cancel()
raise ValueError("Pterodactyl API key not set. Please set it using `[p]set api`.")
base_url = await config.base_url()
if base_url is None:
self.task.cancel()
raise ValueError("Pterodactyl base URL not set. Please set it using `[p]pterodactyl config url`.")
server_id = await config.server_id()
if server_id is None:
self.task.cancel()
raise ValueError("Pterodactyl server ID not set. Please set it using `[p]pterodactyl config serverid`.")
self.client = PterodactylClient(base_url, api_key).client
async def cog_unload(self) -> None:
self.update_topic.cancel()
self.task.cancel()