Compare commits
2 commits
4ba8e656ab
...
52ebccc1d9
Author | SHA1 | Date | |
---|---|---|---|
52ebccc1d9 | |||
6dc8c8abf0 |
1 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ class Pterodactyl(commands.Cog):
|
||||||
headers = {
|
headers = {
|
||||||
"Authorization": f"Bearer {api_key}",
|
"Authorization": f"Bearer {api_key}",
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Accept": "Application/vnd.pterodactyl.v1+json"
|
"Accept": "application/json"
|
||||||
}
|
}
|
||||||
response = requests.get(await self.get_url(interaction.guild, "resources"), headers=headers)
|
response = requests.get(await self.get_url(interaction.guild, "resources"), headers=headers)
|
||||||
response_dict = response.json()
|
response_dict = response.json()
|
||||||
|
@ -120,7 +120,7 @@ class Pterodactyl(commands.Cog):
|
||||||
|
|
||||||
@ui.button(label="Yes", style=discord.ButtonStyle.success)
|
@ui.button(label="Yes", style=discord.ButtonStyle.success)
|
||||||
async def yes_button(self, button:ui.Button, interaction:discord.Interaction):
|
async def yes_button(self, button:ui.Button, interaction:discord.Interaction):
|
||||||
requests.post(await Pterodactyl.get_url(interaction.guild, "power"), headers=self.passed_info['headers'], json={"signal": "stop"})
|
requests.post(await Pterodactyl.get_url(self.passed_info['interaction'].guild, "power"), headers=self.passed_info['headers'], json={"signal": "stop"})
|
||||||
await self.passed_info['interaction'].edit_original_response("Server stopping...", view=None)
|
await self.passed_info['interaction'].edit_original_response("Server stopping...", view=None)
|
||||||
while True:
|
while True:
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
|
|
Reference in a new issue