diff --git a/pterodactyl/ptero.py b/pterodactyl/ptero.py index f2e718c..121dce3 100644 --- a/pterodactyl/ptero.py +++ b/pterodactyl/ptero.py @@ -12,12 +12,12 @@ class Pterodactyl(commands.Cog): server_id="d6d05b41-4da5-4c5b-9ee6-6e25f61a596b" ) - def get_url(self, ctx, endpoint = None): + async def get_url(self, ctx, endpoint = None): """Returns the base url for the Servers API, or the url for a specific endpoint if one is provided.""" - if not self.config.guild(ctx.guild).server_id(): + if not await self.config.guild(ctx.guild).server_id(): raise LookupError("Server ID not set.") - base_url = self.config.guild(ctx.guild).base_url() - server_id = self.config.guild(ctx.guild).server_id() + base_url = await self.config.guild(ctx.guild).base_url() + server_id = await self.config.guild(ctx.guild).server_id() url = f"https://{base_url}/api/client/servers/{server_id}/" if endpoint: url += endpoint @@ -28,7 +28,7 @@ class Pterodactyl(commands.Cog): """This does stuff!""" # Your code will go here if endpoint: - url = self.get_url(ctx, endpoint) + url = await self.get_url(ctx, endpoint) else: - url = self.get_url(ctx) + url = await self.get_url(ctx) await ctx.send(url)