按下电报机器人键盘的按钮但不发送消息

Press button of telegram bot keyboard but do not send out the message

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

此处是键盘的简单代码示例。

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

除了内联键盘,我愿意使用任何类型的键盘。 objective 是为用户提供模板消息。

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

我了解到您想为用户预填文本字段, 正如 中所解释的那样,使用 switch_inline_query_current_chat 是可能的。你必须打开 botfather 中的 inline_mode 才能工作。此外,在用户 @botusername 的文本字段中将添加

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