MCPcopy Create free account
hub / github.com/eternnoir/pyTelegramBotAPI / process_age_step

Function process_age_step

examples/step_example.py:45–60  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

43
44
45def process_age_step(message):
46 try:
47 chat_id = message.chat.id
48 age = message.text
49 if not age.isdigit():
50 msg = bot.reply_to(message, 'Age should be a number. How old are you?')
51 bot.register_next_step_handler(msg, process_age_step)
52 return
53 user = user_dict[chat_id]
54 user.age = age
55 markup = types.ReplyKeyboardMarkup(one_time_keyboard=True)
56 markup.add('Male', 'Female')
57 msg = bot.reply_to(message, 'What is your gender', reply_markup=markup)
58 bot.register_next_step_handler(msg, process_sex_step)
59 except Exception as e:
60 bot.reply_to(message, 'oooops')
61
62
63def process_sex_step(message):

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
reply_toMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…