Uploading photo to a channel functionality added.

This commit is contained in:
nightghost 2019-09-01 22:00:09 +03:00
parent ffe77fb717
commit 696aebd64c
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.
//