Refactor Pterodactyl cog to use aiohttp #2

Merged
cswimr merged 26 commits from aiohttp-refactor into main 2023-07-24 09:29:55 -04:00
Showing only changes of commit 610e9902a9 - Show all commits

View file

@ -202,7 +202,7 @@ class Pterodactyl(commands.Cog):
await interaction.response.defer(ephemeral=True, thinking=True)
interaction_message = await interaction.original_response()
headers = await self.get_headers(interaction.guild)
async with requests.get(await self.get_url(interaction.guild, "resources"), headers=headers) as response:
async with self.session.get(await self.get_url(interaction.guild, "resources"), headers=headers) as response:
response_json = await response.json()
current_status = response_json['attributes']['current_state']
if current_status == "running" or current_status == "starting":