【问题标题】:Python Telegram, How to save user input as stringPython Telegram,如何将用户输入保存为字符串
【发布时间】:2020-07-24 05:09:33
【问题描述】:

我正在制作一个 Telegram 交易机器人,它将在收到用户的字符串后创建订单。如何让机器人接收该字符串?

【问题讨论】:

    标签: python input telegram binance


    【解决方案1】:

    您可以使用文本处理程序。它将字典传递给函数。字典中包含了很多有用的信息,比如消息文本、用户名、id等。

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

    您也可以考虑documentation 和具体示例。

    【讨论】:

      猜你喜欢
      • 2014-11-26
      • 2023-04-08
      • 2021-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-19
      • 2016-06-01
      相关资源
      最近更新 更多