-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Closed
Copy link
Labels
📋 pending-reviewwork status: pending-reviewwork status: pending-review
Milestone
Description
Steps to reproduce
- Create an inline query result containing a callback inline keyboard button, and insert it into a conversation. Activate the button via Telegram to receive a
CallbackQuery
. - Answer the
CallbackQuery
. Take note of its originatinginline_message_id
. - Attempt to run
editMessageText
usinginline_message_id
.
Expected behaviour
Success with edited message returned
Actual behaviour
AttributeError: 'bool' object has no attribute 'get'
Caused by
return Message.de_json(result)
on line 1081 of telegram/bot.py
Caused by the Telegram Bot API returning {"ok": true, "result": true}
instead of the edited message when inline_message_id
is used. The Message.de_json
expects a Message
but gets a bool
instead.
Suggested change
Check that the result is not a simple boolean before attempting to Message.de_json
it.
Configuration
Operating System:
OS X El Capitan
Version of Python:
$ python -V
Python 2.7.11
Version of python-telegram-bot:
$ python -c 'import telegram; print(telegram.__version__)'
4.2.0
Metadata
Metadata
Assignees
Labels
📋 pending-reviewwork status: pending-reviewwork status: pending-review