async def schedule(message): user = await User.get_or_create(telegram_id=message.from_user.id) if not user.group_id: return await bot.send_message(message.chat.id, phrases.user_has_no_group(), reply_markup=menu.default_menu()) await bot.send_message(message.chat.id, phrases.schedule(), reply_markup=menu.schedule_menu())
async def change_group_select_group(message: types.Message, state: FSMContext): if message.text == Keyboard.BACK: await state.set_state('change_group_select_course') return await setting_change_group(message, state) save = await state.get_data() course = save.get('course') group = await Group.get(message.text, course) if not group: await bot.send_message(message.chat.id, phrases.group_unknown()) message.text = course await change_group_select_course(message, state) return user = await User.get_or_create(telegram_id=message.from_user.id) await user.set_group(group.id) await bot.send_message(message.chat.id, phrases.group_success(), reply_markup=menu.default_menu()) await state.finish()
async def unknown(message): await bot.send_message(message.chat.id, phrases.unknown_cmd(), reply_markup=menu.default_menu())
async def back(message): await bot.send_message(message.chat.id, phrases.back(), reply_markup=menu.default_menu())
async def user_help(message): await bot.send_message(message.chat.id, phrases.user_help(), reply_markup=menu.default_menu())