From 62e9de1a3b79e57d884dcec8ef22ed6db2dc0df0 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 18 Jun 2017 23:59:52 +0200 Subject: Use the last (and biggest) photo to relay (telegram). Closes #184 --- bridge/telegram/telegram.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go index 9f7af284..48ad672a 100644 --- a/bridge/telegram/telegram.go +++ b/bridge/telegram/telegram.go @@ -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) -- cgit v1.2.3