mirror of
https://github.com/catspace-dev/unicheckbot.git
synced 2024-11-25 07:13:44 +03:00
fix session closing bug
This commit is contained in:
parent
00ea38b251
commit
4ca6ae50cc
|
@ -47,11 +47,12 @@ async def send_api_requests(endpoint: str, data: dict, nodes: List[APINode]):
|
||||||
yield res
|
yield res
|
||||||
|
|
||||||
|
|
||||||
async def send_message_to_admins(message: str):
|
async def send_message_to_admins(message: str) -> None:
|
||||||
if NOTIFICATION_BOT_TOKEN:
|
if NOTIFICATION_BOT_TOKEN:
|
||||||
bot = Bot(token=NOTIFICATION_BOT_TOKEN)
|
bot = Bot(token=NOTIFICATION_BOT_TOKEN)
|
||||||
for user in NOTIFICATION_USERS:
|
for user in NOTIFICATION_USERS:
|
||||||
logger.info(f"Sended notification to {user}")
|
logger.info(f"Sended notification to {user}")
|
||||||
await bot.send_message(user, message, parse_mode='Markdown')
|
await bot.send_message(user, message, parse_mode='Markdown')
|
||||||
|
await bot.close()
|
||||||
else:
|
else:
|
||||||
logger.warning(f"Notificator bot token not setted. Skipping send notifications to admin")
|
logger.warning(f"Notificator bot token not setted. Skipping send notifications to admin")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user