MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / start

Function start

examples/persistentconversationbot.py:55–70  ·  view source on GitHub ↗

Start the conversation, display any stored data and ask user for input.

(update: Update, context: ContextTypes.DEFAULT_TYPE)

Source from the content-addressed store, hash-verified

53
54
55async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int:
56 """Start the conversation, display any stored data and ask user for input."""
57 reply_text = "Hi! My name is Doctor Botter."
58 if context.user_data:
59 reply_text += (
60 f" You already told me your {', '.join(context.user_data.keys())}. Why don't you "
61 "tell me something more about yourself? Or change anything I already know."
62 )
63 else:
64 reply_text += (
65 " I will hold a more complex conversation with you. Why don't you tell me "
66 "something about yourself?"
67 )
68 await update.message.reply_text(reply_text, reply_markup=markup)
69
70 return CHOOSING
71
72
73async def regular_choice(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int:

Callers

nothing calls this directly

Calls 1

reply_textMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…