0

I am making a Telegram trading bot that will create an order after receiving a string from the user. How can I make the bot receive that string?

Mihail Duchev
  • 4,691
  • 10
  • 25
  • 32
Rai13
  • 13
  • 2

1 Answers1

0

You can use the text handler. It passes a dictionary to the function. The dictionary contains a lot of useful information such as the message text, user's name, and id, etc.

@bot.message_handler(content_types=["text"])
def handle_text(message):

    print(message)
    your_str = message.text

You may also consider the documentation and the examples in particular.

student
  • 68
  • 1
  • 11