Add ParseMode option support to EditMedia

This commit is contained in:
demiangetman 2019-11-06 16:46:35 +03:00 committed by Viktor Oreshkin
parent 97589a3d9e
commit 921282a488

9
bot.go
View File

@ -803,6 +803,7 @@ func (b *Bot) EditMedia(message Editable, inputMedia InputMedia, options ...inte
Type string `json:"type"` Type string `json:"type"`
Caption string `json:"caption"` Caption string `json:"caption"`
Media string `json:"media"` Media string `json:"media"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Video. // Video.
Width int `json:"width,omitempty"` Width int `json:"width,omitempty"`
@ -824,7 +825,12 @@ func (b *Bot) EditMedia(message Editable, inputMedia InputMedia, options ...inte
Performer string `json:"performer,omitempty"` Performer string `json:"performer,omitempty"`
} }
resultMedia := &FileJson{Media: mediaRepr} sendOpts := extractOptions(options)
resultMedia := &FileJson{
Media: mediaRepr,
ParseMode: sendOpts.ParseMode,
}
switch y := inputMedia.(type) { switch y := inputMedia.(type) {
case *Photo: case *Photo:
@ -880,7 +886,6 @@ func (b *Bot) EditMedia(message Editable, inputMedia InputMedia, options ...inte
file["thumb"] = *thumb.MediaFile() file["thumb"] = *thumb.MediaFile()
} }
sendOpts := extractOptions(options)
embedSendOptions(params, sendOpts) embedSendOptions(params, sendOpts)
respJSON, err := b.sendFiles("editMessageMedia", file, params) respJSON, err := b.sendFiles("editMessageMedia", file, params)