python - 如何在 python-telegram-bot 包装器中使用 ForceReply

标签 python telegram python-telegram-bot

我已经尝试了很长时间,阅读了 python-telegram-bot wrapper API python-telegram-bot wrapper , Telegram Bot API,代码片段等,但我缺乏理解(我的编程知识是选择性的谷歌复制粘贴)不允许我成功实现 ForceReply 选项。 ( ForceReply

基本上,我正在尝试的是当用户键入/sett 时,机器人会说“输入否”。并强制用户回复该消息。

抱歉,如果我遗漏了一些明显的东西。

最佳答案

bot.send_message(chat_id, 'Enter No.', reply_markup=ForceReply())

关于python - 如何在 python-telegram-bot 包装器中使用 ForceReply,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49181512/

相关文章:

Telegram Bot API : obtain all groups my bot is a member of

python-2.7 - 使用内联菜单发送图像或文档

python - 如何通过电报机器人发送 PIL 图像而不将其保存到文件中

python - 变量将被多次实例化

python - 在方法调用参数中,如何覆盖解压字典的关键字参数?

python - 关于 PJSUA 和编解码器的问题

telegram - 如何从桌面应用程序将联系人列表导入到 telegram?

python - 如何使用python在 Telegram 上发送照片

python-telegram-bot - 电报API : doesn't send message to user until receive first message from that user

python - `pip install` 带有所有附加功能