fix
This commit is contained in:
@@ -15,8 +15,14 @@ type ChannelMessage struct {
|
||||
}
|
||||
|
||||
type ChannelMessageMedia struct {
|
||||
Photo string
|
||||
Video string
|
||||
Photo string
|
||||
Video string
|
||||
WebPage ChannelMessageMediaWebPage
|
||||
}
|
||||
|
||||
type ChannelMessageMediaWebPage struct {
|
||||
Title string
|
||||
URL string
|
||||
}
|
||||
|
||||
func NewChannelMessage(id, ts int) *ChannelMessage {
|
||||
@@ -43,6 +49,11 @@ func (c *ChannelMessage) WithVideo(video string) *ChannelMessage {
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *ChannelMessage) WithWebPage(title, url string) *ChannelMessage {
|
||||
c.Medias = append(c.Medias, ChannelMessageMedia{WebPage: ChannelMessageMediaWebPage{Title: title, URL: url}})
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *ChannelMessage) GetMedia() string {
|
||||
b, _ := json.Marshal(c.Medias)
|
||||
return string(b)
|
||||
|
||||
Reference in New Issue
Block a user