fix(pterodactyl): fix a ruff violation
Some checks failed
Actions / Build Documentation (MkDocs) (push) Successful in 44s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 51s

This commit is contained in:
cswimr 2025-01-26 13:09:15 +00:00
parent 5decc51a36
commit d5a248733a
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -3,8 +3,8 @@ import aiohttp
async def get_status(host: str, port: int = 25565) -> tuple[bool, dict]:
async with aiohttp.ClientSession() as session:
async with session.get(f'https://api.mcsrvstat.us/2/{host}:{port}') as response:
response = await response.json()
if response['online']:
async with session.get(f"https://api.mcsrvstat.us/2/{host}:{port}") as response:
response = await response.json() # noqa: PLW2901
if response["online"]:
return (True, response)
return (False, response)