python_bot/handlers/coding.py
Pavel_Duron aae4506ffe
All checks were successful
continuous-integration/drone/push Build is passing
testx
2022-12-06 20:57:57 +10:00

13 lines
538 B
Python

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