我如何从用户电报机器人获取信息?

How can I get information from the user telegram bot?

For example, the bot sends "Send me your name", "Send me your last name" and saves this data in two variables.my language is python and i used telepot package for make the bot

Check out this link. Scroll down for examples. Hope this helps!

In telepot package:

import telepot
from telepot.loop import MessageLoop
import time
bot = telepot.Bot('my_token')
def handle(msg):
    content_type, chat_type, chat_id = telepot.glance(msg)
    send1 = bot.sendMessage(chat_id,'whats your name?')
    if send1:
        text1 = msg['text']
        print(text1)


MessageLoop(bot,handle).run_as_thread()
while 1:
    time.sleep(1)

text1 variable is the reply associate to question "whats your name?"