(message: types.Message, state: StateContext)
| 74 | # Handler for color input |
| 75 | @bot.message_handler(state=MyStates.color) |
| 76 | def ask_hobby(message: types.Message, state: StateContext): |
| 77 | state.set(MyStates.hobby) |
| 78 | state.add_data(color=message.text) |
| 79 | |
| 80 | # Define reply keyboard for hobby selection |
| 81 | keyboard = types.ReplyKeyboardMarkup(row_width=2) |
| 82 | hobbies = ["Reading", "Traveling", "Gaming", "Cooking"] |
| 83 | buttons = [types.KeyboardButton(hobby) for hobby in hobbies] |
| 84 | keyboard.add(*buttons) |
| 85 | |
| 86 | bot.send_message( |
| 87 | message.chat.id, |
| 88 | "What is one of your hobbies? Choose from the options below.", |
| 89 | reply_markup=keyboard, |
| 90 | reply_parameters=ReplyParameters(message_id=message.message_id), |
| 91 | ) |
| 92 | |
| 93 | |
| 94 | # Handler for hobby input |
nothing calls this directly
no test coverage detected
searching dependent graphs…