15 lines
388 B
Python
15 lines
388 B
Python
import aiohttp
|
|
from bot.db import db, DBTables, decrypt
|
|
|
|
|
|
async def ping():
|
|
endpoint = decrypt(db[DBTables.config].get('endpoint'))
|
|
try:
|
|
async with aiohttp.ClientSession() as session:
|
|
r = await session.head(endpoint)
|
|
if r.status != 200:
|
|
return False
|
|
return True
|
|
except aiohttp.ClientConnectorError:
|
|
return False
|