all repos — telegram-bot-api @ e840fa3b0f728e74733458cfb8a62e673f6a4bfd

Golang bindings for the Telegram Bot API

Finish Bot API 3.4.
Syfaro syfaro@huefox.com
Fri, 29 Dec 2017 13:06:58 -0600
commit

e840fa3b0f728e74733458cfb8a62e673f6a4bfd

parent

72f87b43e3794101f980c610fcadd3fcdcf73bc9

2 files changed, 53 insertions(+), 5 deletions(-)

jump to
M configs.goconfigs.go

@@ -1715,3 +1715,51 @@ v.Add("sticker", config.Sticker)

return v, nil } + +// SetChatStickerSetConfig allows you to set the sticker set for a supergroup. +type SetChatStickerSetConfig struct { + ChatID int64 + SuperGroupUsername string + + StickerSetName string +} + +func (config SetChatStickerSetConfig) method() string { + return "setChatStickerSet" +} + +func (config SetChatStickerSetConfig) values() (url.Values, error) { + v := url.Values{} + + if config.SuperGroupUsername == "" { + v.Add("chat_id", strconv.FormatInt(config.ChatID, 10)) + } else { + v.Add("chat_id", config.SuperGroupUsername) + } + + v.Add("sticker_set_name", config.StickerSetName) + + return v, nil +} + +// DeleteChatStickerSetConfig allows you to remove a supergroup's sticker set. +type DeleteChatStickerSetConfig struct { + ChatID int64 + SuperGroupUsername string +} + +func (config DeleteChatStickerSetConfig) method() string { + return "deleteChatStickerSet" +} + +func (config DeleteChatStickerSetConfig) values() (url.Values, error) { + v := url.Values{} + + if config.SuperGroupUsername == "" { + v.Add("chat_id", strconv.FormatInt(config.ChatID, 10)) + } else { + v.Add("chat_id", config.SuperGroupUsername) + } + + return v, nil +}
M types.gotypes.go

@@ -658,12 +658,12 @@ }

// InlineQueryResultLocation is an inline query response location. type InlineQueryResultLocation struct { - Type string `json:"type"` // required - ID string `json:"id"` // required - Latitude float64 `json:"latitude"` // required - Longitude float64 `json:"longitude"` // required + Type string `json:"type"` // required + ID string `json:"id"` // required + Latitude float64 `json:"latitude"` // required + Longitude float64 `json:"longitude"` // required LivePeriod int `json:"live_period"` // optional - Title string `json:"title"` // required + Title string `json:"title"` // required ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` InputMessageContent interface{} `json:"input_message_content,omitempty"` ThumbURL string `json:"thumb_url"`