diff --git a/configs.go b/configs.go index aff0cd9..5524207 100644 --- a/configs.go +++ b/configs.go @@ -349,6 +349,7 @@ func (config AudioConfig) method() string { // DocumentConfig contains information about a SendDocument request. type DocumentConfig struct { BaseFile + Caption string } // values returns a url.Values representation of DocumentConfig. @@ -360,6 +361,10 @@ func (config DocumentConfig) values() (url.Values, error) { v.Add(config.name(), config.FileID) + if config.Caption != "" { + v.Add("caption", config.Caption) + } + return v, nil } diff --git a/telegram-bot-api.iml b/telegram-bot-api.iml new file mode 100644 index 0000000..8c53b5c --- /dev/null +++ b/telegram-bot-api.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/types.go b/types.go index c852f86..d41dd02 100644 --- a/types.go +++ b/types.go @@ -358,9 +358,9 @@ type InlineKeyboardButton struct { Text string `json:"text"` URL *string `json:"url,omitempty"` // optional CallbackData *string `json:"callback_data,omitempty"` // optional - SwitchInlineQuery *string `json:"switch_inline_query,omitempty"` // optional - SwitchInlineQueryCurrentChat *string `json:"switch_inline_query_current_chat"` // optional - CallbackGame *CallbackGame `json:"callback_game"` // optional + SwitchInlineQuery *string `json:"switch_inline_query,omitempty,omitempty"` // optional + SwitchInlineQueryCurrentChat *string `json:"switch_inline_query_current_chat,omitempty"` // optional + CallbackGame *CallbackGame `json:"callback_game,omitempty"` // optional } // CallbackQuery is data sent when a keyboard button with callback data @@ -607,8 +607,8 @@ type ChosenInlineResult struct { // as an inline query result. type InputTextMessageContent struct { Text string `json:"message_text"` - ParseMode string `json:"parse_mode"` - DisableWebPagePreview bool `json:"disable_web_page_preview"` + ParseMode string `json:"parse_mode,omitempty"` + DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"` } // InputLocationMessageContent contains a location for displaying