add message 1 and message 2 with logs to check

This commit is contained in:
Dmitry Afanasyev 2022-08-14 14:15:20 +03:00
parent 55f516b21b
commit 8cd466fc91
2 changed files with 20 additions and 0 deletions

View File

@ -5,6 +5,8 @@ from aiogram.contrib.middlewares.logging import LoggingMiddleware
from aiogram.dispatcher import Dispatcher
from aiogram.dispatcher.webhook import SendMessage
from aiogram.utils.callback_data import CallbackData
from app.core.logger import logger
from core.parse_web import configure_firefox_driver, download_gecko_driver, parse_site
from settings import API_TOKEN
@ -35,6 +37,24 @@ def get_keyboard() -> types.InlineKeyboardMarkup:
return markup
@dispatcher.message_handler(commands=['command1'])
async def chat_id(message: types.Message) -> None:
logger.info("command 1 started")
await asyncio.sleep(15)
await bot.send_message(message.chat.id, 'message 1 on screen')
logger.info('command 1 ends')
@dispatcher.message_handler(commands=['command2'])
async def chat_id(message: types.Message) -> None:
logger.info("command 2 started")
await asyncio.sleep(15)
await bot.send_message(message.chat.id, 'message 2 on screen')
logger.info('command 2 ends')
@dispatcher.callback_query_handler(stations_cb.filter(direction='home->office'))
async def home_office(
query: types.CallbackQuery, callback_data: dict[str, str]

View File