【问题标题】:Press button of telegram bot keyboard but do not send out the message按下电报机器人键盘的按钮但不发送消息
【发布时间】:2020-10-10 13:00:38
【问题描述】:

我想让用户按下电报机器人键盘的按钮,但不发送消息。该消息将出现在消息框中,供用户进一步编辑,但不会发送出去。目的是生成模板消息供用户进一步编辑。

这里有一个简单的键盘代码示例。

https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/inlinekeyboard.py

我愿意使用除内联键盘之外的任何类型的键盘。目标是为用户提供模板消息。

我正在使用 python telegram bot v12.7 和 python 3.7。

【问题讨论】:

    标签: python python-3.x telegram telegram-bot python-telegram-bot


    【解决方案1】:

    我收集到您想为用户预填充文本字段, switch_inline_query_current_chat 可以做到这一点,如 stackoverflow 中所述。您必须打开botfather 中的inline_mode 才能使其工作。另外,会在用户@botusername的文本字段中添加

    python-telegram-bot 的文档可以在here找到

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-10-19
      • 1970-01-01
      • 2017-03-19
      • 1970-01-01
      • 2017-09-01
      • 2016-10-22
      • 2016-03-11
      • 1970-01-01
      相关资源
      最近更新 更多