Uploading photo to a channel functionality added.
This commit is contained in:
parent
ffe77fb717
commit
696aebd64c
2 changed files with 64 additions and 0 deletions
18
helpers.go
18
helpers.go
|
@ -67,6 +67,24 @@ func NewPhotoUpload(chatID int64, file interface{}) PhotoConfig {
|
|||
}
|
||||
}
|
||||
|
||||
// NewPhotoUploadToChannel creates a new photo uploader to send a photo to a channel.
|
||||
//
|
||||
// username is the username of the channel, file is a string path to the file,
|
||||
// FileReader, or FileBytes.
|
||||
//
|
||||
// Note that you must send animated GIFs as a document.
|
||||
func NewPhotoUploadToChannel(username string, file interface{}) PhotoConfig {
|
||||
return PhotoConfig{
|
||||
BaseFile: BaseFile{
|
||||
BaseChat: BaseChat{
|
||||
ChannelUsername: username,
|
||||
},
|
||||
File: file,
|
||||
UseExisting: false,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPhotoShare shares an existing photo.
|
||||
// You may use this to reshare an existing photo without reuploading it.
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue