diff --git a/telegram.go b/telegram.go index d2eb7c0cdf73b6ca6087532072e839e7d19a4eb3..832d7e90db5e4ffdb8ff23ed1d3c04361c994cc0 100644 --- a/telegram.go +++ b/telegram.go @@ -165,8 +165,17 @@ func respondTelegram(update tgbotapi.Update) { header, has := telegramMakeHeader(update.Message, false) - if update.Message.Photo != nil { + if update.Message.Document != nil { + if telegramHandleFile(dc, update, update.Message.Document.FileID, update.Message.Caption, + header, has, reference, + &dMessageID, &dChannelID, &dGuildID) { + log.Printf("T%vM%v -> D%vM%s @%s (%v) [document]: %s; caption: %s", + tc.ID, update.Message.MessageID, dc.ID, dMessageID, username, id, update.Message.Document.FileID, update.Message.Caption) + } + return + } + if update.Message.Photo != nil { p := *update.Message.Photo if telegramHandleFile(dc, update, p[len(p)-1].FileID, update.Message.Caption, header, has, reference, @@ -174,7 +183,6 @@ func respondTelegram(update tgbotapi.Update) { log.Printf("T%vM%v -> D%vM%s @%s (%v) [photo]: %s; caption: %s", tc.ID, update.Message.MessageID, dc.ID, dMessageID, username, id, p[len(p)-1].FileID, update.Message.Caption) } - return }