jTelegram / jTelegramBotAPI

Java Telegram Bot API Wrapper
https://jtelegram.github.io/jTelegramBotAPI/
MIT License
20 stars 12 forks source link

Don't always include the pay variable in a button's representation #29

Closed nickrobson closed 6 years ago

nickrobson commented 6 years ago

Currently, InlineKeyboardButton always includes "pay":false in its JSON representation. This breaks some of the other button types, such as switch_inline_query_current_chat, for which Telegram will error out when set.

My assumption is that this is caused by Telegram checking pay before switch_inline_query_current_chat, but after callback_data (or else I believe this bug would have been found before.)

The fix is super simple, and just uses the Boolean wrapper type instead of the boolean primitive.