@@ -54,7 +54,8 @@ async def handle_topic(message: types.Message, state: FSMContext):
5454 # Send plan to chat
5555 plan_text = "\n " .join (plan )
5656 if len (plan_text ) > 4000 :
57- plan_text = plan_text [:4000 ] + "...\n (The plan is too long, the full version will be in the file)"
57+ plan_text = plan_text [:4000 ] + "...\n (The plan is too long, the full version will \
58+ be in the file)"
5859
5960 await message .answer (f"📚 Your study plan:\n \n { plan_text } " )
6061
@@ -64,11 +65,21 @@ async def handle_topic(message: types.Message, state: FSMContext):
6465 "In which format do you want to save the plan?" ,
6566 reply_markup = types .InlineKeyboardMarkup (
6667 inline_keyboard = [
67- [types .InlineKeyboardButton (text = "📄 pdf" , callback_data = "format_pdf" ),
68- types .InlineKeyboardButton (text = "📄 txt" , callback_data = "format_txt" )],
69- [types .InlineKeyboardButton (text = "🔄 Skip" , callback_data = "format_skip" )]
68+ [
69+ types .InlineKeyboardButton (
70+ text = "📄 pdf" , callback_data = "format_pdf"
71+ ),
72+ types .InlineKeyboardButton (
73+ text = "📄 txt" , callback_data = "format_txt"
74+ ),
75+ ],
76+ [
77+ types .InlineKeyboardButton (
78+ text = "🔄 Skip" , callback_data = "format_skip"
79+ )
80+ ],
7081 ]
71- )
82+ ),
7283 )
7384
7485
@@ -90,11 +101,14 @@ async def process_format(callback: types.CallbackQuery, state: FSMContext):
90101 caption = "📘 Your study plan in PDF"
91102 )
92103 else :
93- txt_path = await save_plan_to_txt (plan , callback .from_user .id if callback .from_user else 0 )
104+ txt_path = await save_plan_to_txt (
105+ plan , callback .from_user .id if callback .from_user else 0 )
94106 if isinstance (callback .message , Message ):
95107 await callback .message .answer_document (
96108 document = types .FSInputFile (txt_path ),
97- caption = "📄 Your study plan in TXT"
109+ caption = (
110+ "📚 Your saved study plan"
111+ ),
98112 )
99113 if isinstance (callback .message , Message ):
100114 await show_next_actions (callback .message , state )
@@ -131,7 +145,9 @@ async def handle_reminders(callback: types.CallbackQuery, state: FSMContext):
131145 await callback .message .answer ("Plan not found. Try creating a new one." )
132146 return
133147 # Start reminder scheduling
134- message = await callback .message .answer ("⏳ Scheduling reminders..." ) if isinstance (callback .message , Message ) else None
148+ message = await callback .message .answer ("⏳ Scheduling reminders..." ) if isinstance (
149+ callback .message , Message
150+ ) else None
135151 # Run async reminder scheduling task
136152 reminders_count = await schedule_reminders (user_id , plan )
137153 # Update message after scheduling completion
@@ -153,7 +169,8 @@ async def handle_new_plan(callback: types.CallbackQuery, state: FSMContext):
153169async def handle_goodbye (callback : types .CallbackQuery , state : FSMContext ):
154170 await callback .answer ()
155171 if isinstance (callback .message , Message ):
156- await callback .message .edit_text ("Have a nice day! 👋 I'll be happy to help again when you need it." )
172+ await callback .message .edit_text ("Have a nice day! 👋 I'll be happy to help \
173+ again when you need it." )
157174 await state .clear ()
158175
159176
@@ -173,4 +190,6 @@ async def cmd_my_plans(message: types.Message):
173190 await message .answer_document (document = types .FSInputFile (txt_path ),
174191 caption = "📚 Your saved study plan" )
175192 else :
176- await message .answer (f"📚 Your saved study plan:\n \n { plan_text } " )
193+ await message .answer (
194+ f"📚 Your saved study plan:\n \n { plan_text } "
195+ )
0 commit comments