|
|
|
@ -747,7 +747,7 @@ func (b *Bot) EditReplyMarkup(message Editable, markup *ReplyMarkup) (*Message,
|
|
|
|
|
// EditCaption used to edit already sent photo caption with known recepient and message id.
|
|
|
|
|
//
|
|
|
|
|
// On success, returns edited message object
|
|
|
|
|
func (b *Bot) EditCaption(message Editable, caption string) (*Message, error) {
|
|
|
|
|
func (b *Bot) EditCaption(message Editable, caption string, options ...interface{}) (*Message, error) {
|
|
|
|
|
messageID, chatID := message.MessageSig()
|
|
|
|
|
|
|
|
|
|
params := map[string]string{"caption": caption}
|
|
|
|
@ -760,6 +760,9 @@ func (b *Bot) EditCaption(message Editable, caption string) (*Message, error) {
|
|
|
|
|
params["message_id"] = messageID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sendOpts := extractOptions(options)
|
|
|
|
|
embedSendOptions(params, sendOpts)
|
|
|
|
|
|
|
|
|
|
respJSON, err := b.Raw("editMessageCaption", params)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
@ -805,6 +808,7 @@ func (b *Bot) EditMedia(message Editable, inputMedia InputMedia, options ...inte
|
|
|
|
|
Type string `json:"type"`
|
|
|
|
|
Caption string `json:"caption"`
|
|
|
|
|
Media string `json:"media"`
|
|
|
|
|
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
|
|
|
|
|
|
|
|
|
// Video.
|
|
|
|
|
Width int `json:"width,omitempty"`
|
|
|
|
@ -828,6 +832,11 @@ func (b *Bot) EditMedia(message Editable, inputMedia InputMedia, options ...inte
|
|
|
|
|
|
|
|
|
|
resultMedia := &FileJson{Media: mediaRepr}
|
|
|
|
|
|
|
|
|
|
sendOpts := extractOptions(options)
|
|
|
|
|
if sendOpts != nil {
|
|
|
|
|
resultMedia.ParseMode = sendOpts.ParseMode
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch y := inputMedia.(type) {
|
|
|
|
|
case *Photo:
|
|
|
|
|
resultMedia.Type = "photo"
|
|
|
|
@ -886,7 +895,6 @@ func (b *Bot) EditMedia(message Editable, inputMedia InputMedia, options ...inte
|
|
|
|
|
file["thumb"] = *thumb.MediaFile()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sendOpts := extractOptions(options)
|
|
|
|
|
embedSendOptions(params, sendOpts)
|
|
|
|
|
|
|
|
|
|
respJSON, err := b.sendFiles("editMessageMedia", file, params)
|
|
|
|
|