2017-10-17 11:12:17 +00:00
|
|
|
package telegram
|
|
|
|
|
|
|
|
import json "github.com/pquerna/ffjson/ffjson"
|
|
|
|
|
2018-04-19 13:02:15 +00:00
|
|
|
// EditMessageCaptionParameters represents data for EditMessageCaption method.
|
2017-10-17 11:12:17 +00:00
|
|
|
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"`
|
|
|
|
|
2018-02-14 17:39:58 +00:00
|
|
|
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
|
|
|
|
// fixed-width text or inline URLs in the media caption.
|
|
|
|
ParseMode string `json:"parse_mode,omitempty"`
|
|
|
|
|
2017-10-17 11:12:17 +00:00
|
|
|
// 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.
|
2018-08-21 11:05:04 +00:00
|
|
|
func (bot *Bot) EditMessageCaption(params *EditMessageCaptionParameters) (msg *Message, err error) {
|
2018-02-15 12:32:47 +00:00
|
|
|
dst, err := json.Marshal(params)
|
2017-10-17 11:12:17 +00:00
|
|
|
if err != nil {
|
2018-08-21 11:05:04 +00:00
|
|
|
return
|
2017-10-17 11:12:17 +00:00
|
|
|
}
|
|
|
|
|
2018-04-12 11:58:05 +00:00
|
|
|
resp, err := bot.request(dst, MethodEditMessageCaption)
|
2017-10-17 11:12:17 +00:00
|
|
|
if err != nil {
|
2018-08-21 11:05:04 +00:00
|
|
|
return
|
2017-10-17 11:12:17 +00:00
|
|
|
}
|
|
|
|
|
2018-08-21 11:05:04 +00:00
|
|
|
msg = new(Message)
|
|
|
|
err = json.Unmarshal(*resp.Result, msg)
|
|
|
|
return
|
2017-10-17 11:12:17 +00:00
|
|
|
}
|