1- from typing import Optional
2-
31from aiogram import Bot
42from aiogram .enums import ChatAction
53from aiogram .fsm .context import FSMContext
6- from aiogram .types import Message , CallbackQuery
4+ from aiogram .types import CallbackQuery , Message
75
86from bot .callbacks .callback import SaveCallbackFactory
97from bot .keyboards .keyboards import Keyboards
1210
1311
1412class Handlers :
15-
1613 def __init__ (self , bot : Bot , kb : Keyboards , bot_service : BotService ):
1714 self .bot = bot
1815 self .kb = kb
@@ -38,8 +35,8 @@ async def answer_fsm_state_1(self, message: Message, state: FSMContext):
3835
3936 async def answer_fsm_state_2 (self , message : Message , state : FSMContext ):
4037 await state .update_data (step_2 = message .text )
41- data = await state .get_data ()
42- await message .answer (f"Step 1: { data ['step_1' ]} \n " f"Step 2: { data ['step_2' ]} " )
38+ data = await state .get_data ()
39+ await message .answer (f"Step 1: { data ['step_1' ]} \n Step 2: { data ['step_2' ]} " )
4340 await state .clear ()
4441
4542 async def answer_inline_button (self , message : Message ):
@@ -53,7 +50,7 @@ async def process_any_inline_button_press(self, callback: CallbackQuery, callbac
5350 await callback .message .answer (text = callback_data .pack ())
5451 await callback .answer ()
5552
56- async def __send_message (self , chat_id : int , text : str , reply_to_message_id : Optional [ int ] = None ) -> int :
53+ async def __send_message (self , chat_id : int , text : str , reply_to_message_id : int | None = None ) -> int :
5754 await self .bot .send_chat_action (chat_id , ChatAction .TYPING )
5855 message = await self .bot .send_message (chat_id = chat_id , text = text , reply_to_message_id = reply_to_message_id )
5956
0 commit comments