python_bot/handlers/coding.py
Pavel_Duron 45d4aa8c9a
All checks were successful
continuous-integration/drone/push Build is passing
add alarm of job
2022-12-06 20:25:52 +10:00

12 lines
474 B
Python

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