From 09f4a9cb54d79e86e71f9078fbd8676baefe769a Mon Sep 17 00:00:00 2001 From: Hamed Ghasemzadeh Date: Fri, 2 Dec 2016 16:41:30 +0330 Subject: [PATCH 1/4] api is updaed --- telegram-bot-api.iml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 telegram-bot-api.iml 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 From a86ad9cf86f86d2b09fe9b90c7cdf31451eb3e1f Mon Sep 17 00:00:00 2001 From: Hamed Ghasemzadeh Date: Fri, 2 Dec 2016 17:46:29 +0330 Subject: [PATCH 2/4] thumb is added to posts --- types.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types.go b/types.go index b43f4a0..cadb94e 100644 --- a/types.go +++ b/types.go @@ -348,9 +348,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 From 8e95ff936cd82bf8fb6bb1ea1ee5866402fb7568 Mon Sep 17 00:00:00 2001 From: Hamed Ghasemzadeh Date: Sun, 4 Dec 2016 13:35:54 +0330 Subject: [PATCH 3/4] menu is valid for share search can return menu --- types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types.go b/types.go index cadb94e..f3fc8aa 100644 --- a/types.go +++ b/types.go @@ -597,8 +597,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 From a5178b7425aab349bc1f2f76379b28aed5308380 Mon Sep 17 00:00:00 2001 From: Hamed Ghasemzadeh Date: Sun, 4 Dec 2016 16:45:13 +0330 Subject: [PATCH 4/4] caption is corrected for files --- configs.go | 5 +++++ 1 file changed, 5 insertions(+) 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 }