fix: doc
This commit is contained in:
@@ -15,9 +15,10 @@ type ChannelMessage struct {
|
||||
}
|
||||
|
||||
type ChannelMessageMedia struct {
|
||||
Photo string
|
||||
Video string
|
||||
WebPage ChannelMessageMediaWebPage
|
||||
Photo string
|
||||
Video string
|
||||
Document string
|
||||
WebPage ChannelMessageMediaWebPage
|
||||
}
|
||||
|
||||
type ChannelMessageMediaWebPage struct {
|
||||
@@ -49,6 +50,11 @@ func (c *ChannelMessage) WithVideo(video string) *ChannelMessage {
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *ChannelMessage) WithDoc(docID int64, ext string) *ChannelMessage {
|
||||
c.Medias = append(c.Medias, ChannelMessageMedia{Document: fmt.Sprintf("%d.%s", docID, ext)})
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *ChannelMessage) WithWebPage(title, url string) *ChannelMessage {
|
||||
c.Medias = append(c.Medias, ChannelMessageMedia{WebPage: ChannelMessageMediaWebPage{Title: title, URL: url}})
|
||||
return c
|
||||
|
||||
Reference in New Issue
Block a user