botman / driver-telegram

BotMan Telegram Driver
MIT License
86 stars 75 forks source link

Allow to set switch_inline_query or switch_inline_query_current_chat for Button #84

Closed vdomah closed 4 years ago

vdomah commented 4 years ago

Hi! To allow implementing Buttons with Inline mode support we need to make callback_data parameter not mandatory. From docs https://core.telegram.org/bots/api#inlinekeyboardbutton

InlineKeyboardButton
This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

So before this PR setting switch_inline_query param will not affect the result because always existing callback_data param will suppress it.