mirror of
https://github.com/catspace-dev/unicheckbot.git
synced 2024-11-24 06:43:44 +03:00
log warning if notification token not setted
This commit is contained in:
parent
ce576c4160
commit
aff843c867
|
@ -48,7 +48,10 @@ async def send_api_requests(endpoint: str, data: dict, nodes: List[APINode]):
|
|||
|
||||
|
||||
async def send_message_to_admins(message: str):
|
||||
bot = Bot(token=NOTIFICATION_BOT_TOKEN)
|
||||
for user in NOTIFICATION_USERS:
|
||||
logger.info(f"Sended notification to {user}")
|
||||
await bot.send_message(user, message, parse_mode='Markdown')
|
||||
if NOTIFICATION_BOT_TOKEN:
|
||||
bot = Bot(token=NOTIFICATION_BOT_TOKEN)
|
||||
for user in NOTIFICATION_USERS:
|
||||
logger.info(f"Sended notification to {user}")
|
||||
await bot.send_message(user, message, parse_mode='Markdown')
|
||||
else:
|
||||
logger.warning(f"Notificator bot token not setted. Skipping send notifications to admin")
|
Loading…
Reference in New Issue
Block a user