-
Notifications
You must be signed in to change notification settings - Fork 120
Description
Telegram bot api doc states that switch_inline_query_current_chat parameter in InlineKeyboardButton method "May be empty, in which case just the bot's username will be inserted". However trying to send button with empty parameter like this
models.InlineKeyboardButton{
Text: "This button should insert bot's username with no additional text",
SwitchInlineQueryCurrentChat: "",
}fails with "bad request, Bad Request: BUTTON_COPY_TEXT_INVALID" error.
Same Button with single space SwitchInlineQueryCurrentChat: " " works. But this way bot inserts name, default space and additional space we sent. So inlie query has two spaces instead of one and therefore doesn't display placeholder message .
I believe that happens because of SwitchInlineQueryCurrentChat being string and not *string so there's no way for parser to different between unsed zero-valued field and field manually set to be empty.