【发布时间】:2018-09-24 23:03:11
【问题描述】:
我正在使用 python-telegram-bot (python-telegram-bot.org) 从 Python3 与 Telegram 进行通信
我想更新我上次发送的回复。 目前,下面的代码发送消息,然后发送 5 秒后又有一条消息。
def echo(bot, update):
update.message.reply_text("Sorry, you're on your own, kiddo.")
time.sleep(5)
update.message.reply_text("Seriously, you're on your own, kiddo.")
我想更新最后一条消息。
我试过了
bot.editMessageText("Seriously, you're on your own, kiddo.",
chat_id=update.message.chat_id,
message_id=update.message.message_id)
在示例中可以更新用一条消息替换内联键盘,但这会崩溃(并且不会更新我作为机器人发送的最后一条消息)。
【问题讨论】:
标签: python python-telegram-bot