5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 09:20:27 +00:00

Use the last (and biggest) photo to relay (telegram). Closes #184

This commit is contained in:
Wim 2017-06-18 23:59:52 +02:00
parent 2ddc4f7ae9
commit 62e9de1a3b

View File

@ -122,10 +122,8 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
}
if message.Photo != nil {
photos := *message.Photo
// photo 3 is the biggest
if len(photos) == 3 {
text = text + " " + b.getFileDirectURL(photos[2].FileID)
}
// last photo is the biggest
text = text + " " + b.getFileDirectURL(photos[len(photos)-1].FileID)
}
if message.Document != nil {
text = text + " " + message.Document.FileName + " : " + b.getFileDirectURL(message.Document.FileID)