Skip to content

Commit

Permalink
Add support parse_mode for albums photo
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Borovikov authored and stek29 committed Mar 1, 2020
1 parent 209b6f8 commit 9852df3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,13 +556,15 @@ func (b *Bot) SendAlbum(to Recipient, a Album, options ...interface{}) ([]Messag
switch y := x.(type) {
case *Photo:
jsonRepr, _ = json.Marshal(struct {
Type string `json:"type"`
Caption string `json:"caption"`
Media string `json:"media"`
Type string `json:"type"`
Media string `json:"media"`
Caption string `json:"caption,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
}{
"photo",
y.Caption,
mediaRepr,
y.Caption,
y.ParseMode,
})
case *Video:
jsonRepr, _ = json.Marshal(struct {
Expand Down
3 changes: 2 additions & 1 deletion media.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ type Photo struct {
Height int `json:"height"`

// (Optional)
Caption string `json:"caption,omitempty"`
Caption string `json:"caption,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
}

type photoSize struct {
Expand Down

0 comments on commit 9852df3

Please sign in to comment.