add alarm of job fix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pavel_Duron 2022-12-06 20:31:55 +10:00
parent 78759e9a8a
commit 9cbe80b9ed

View File

@ -3,10 +3,11 @@ from create_bot import bot, dp
from sqdb import user, session from sqdb import user, session
@dp.message_handler(commands=['alarm']) @dp.message_handler(commands=['alarm'])
async def notify_chats(message: types.Message): async def notify_chats():
for chats in session.query(user.chat_id).distinct(): for chats in session.query(user.chat_id).distinct():
session.close() session.close()
await bot.send_message(chats,'<b>Ведутся пажилые работы,\n Ожидайте...</b>') await bot.send_message(chats,'<b>Ведутся пажилые работы,\n Ожидайте...</b>')
await bot.send_message(226765676, 'рассылка завершена')
def register_handlers_alarm(dp: Dispatcher): def register_handlers_alarm(dp: Dispatcher):
dp.register_message_handler(notify_chats) dp.register_message_handler(notify_chats)