1
0

Added editMessageCaption method

This commit is contained in:
Maxim Lebedev 2017-10-17 16:12:17 +05:00
parent db6ab69292
commit a3fc9785f9
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F

43
edit_message_caption.go Normal file
View File

@ -0,0 +1,43 @@
package telegram
import json "github.com/pquerna/ffjson/ffjson"
type EditMessageCaptionParameters struct {
// Required if inline_message_id is not specified. Unique identifier for the
// target chat or username of the target channel (in the format
// @channelusername)
ChatID int64 `json:"chat_id,omitempty"`
// Required if inline_message_id is not specified. Identifier of
// the sent message
MessageID int `json:"message_id,omitempty"`
// Required if chat_id and message_id are not specified. Identifier of the
// inline message
InlineMessageID string `json:"inline_message_id,omitempty"`
// New caption of the message
Caption string `json:"caption,omitempty"`
// A JSON-serialized object for an inline keyboard.
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
// EditMessageCaption edit captions of messages sent by the bot or via the bot
// (for inline bots). On success, if edited message is sent by the bot, the
// edited Message is returned, otherwise True is returned.
func (bot *Bot) EditMessageCaption(params *EditMessageCaptionParameters) (*Message, error) {
dst, err := json.Marshal(*params)
if err != nil {
return nil, err
}
resp, err := bot.request(dst, "editMessageCaption", nil)
if err != nil {
return nil, err
}
var data Message
err = json.Unmarshal(*resp.Result, &data)
return &data, err
}