我正在尝试在我的电报机器人中实现“看起来像”动画倒计时:
sent=bot.send_message(message.chat.id,'5')
time.sleep(1)
bot.edit_message_text('4',message.chat.id,sent.message_id)
time.sleep(1)
bot.edit_message_text('3',message.chat.id,sent.message_id)
time.sleep(1)
bot.edit_message_text('2',message.chat.id,sent.message_id)
time.sleep(1)
bot.edit_message_text('1',message.chat.id,sent.message_id)
time.sleep(1)
bot.edit_message_text('0',message.chat.id,sent.message_id)
有时效果很好,但有时我会收到错误:
对 Telegram API 的请求不成功。服务器返回 HTTP 400 错误请求。响应正文:error_code:400,描述:“错误请求:消息未修改