Merge pull request #261 from zergon321/add-photo-upload-channel

Uploading a new photo to a channel functionality added.
This commit is contained in:
Syfaro 2020-07-22 05:00:28 -05:00 committed by GitHub
commit 9d3974d340
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 64 additions and 0 deletions

View file

@ -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.
//