-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[BUG] InlineKeyboardButton with switch_inline_query='' doesn't work #1594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Milestone
Comments
Can confirm. Until fixed, you can use this workaround: >>> from telegram import InlineKeyboardButton
>>> butt = InlineKeyboardButton('inline button', switch_inline_query='')
>>> butt.to_dict()
{'text': 'inline button'}
>>> butt.switch_inline_query = ''
>>> butt.to_dict()
{'text': 'inline button', 'switch_inline_query': ''} |
@davidchoo12 Good catch thanks |
Will hopefully be closed by #1600 |
@Bibo-Joshi We should add test cases for this |
Can confirm it will be closed |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Steps to reproduce
switch_inline_query=''
{'text': 'inline button'}
along with error message: "Can't parse inline keyboard button: text buttons are unallowed in the inline keyboard"
Expected behaviour
The message should appear with the button as documented: "Can be empty, in which case just the bot’s username will be inserted."
Actual behaviour
Message and button doesn't appear and error is thrown
Configuration
Operating System:
Windows 10
Version of Python, python-telegram-bot & dependencies:
$ python -m telegram
python-telegram-bot 12.2.0
certifi 2019.09.11
future 0.18.1
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)]
Logs
The text was updated successfully, but these errors were encountered: