Skip to content
Snippets Groups Projects
Commit c2fbaa35 authored by Ophestra's avatar Ophestra
Browse files

handle documents

parent f77d1884
Branches
No related tags found
No related merge requests found
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment