1
0
mirror of synced 2024-11-21 20:16:02 +03:00

pass item id as name

This commit is contained in:
Pavel 2019-08-28 11:41:30 +03:00
parent 46810dab09
commit 2ce3f44898
4 changed files with 12 additions and 4 deletions

View File

@ -1056,7 +1056,7 @@ func setAttachment(attachments *tgbotapi.Message, client *v1.MgClient, snd *v1.S
item := v1.Item{}
fileUrl := fmt.Sprintf("https://api.telegram.org/file/bot%s/%s", botToken, file.FilePath)
switch {
case t == "sticker" || t == "voice" || t == "animation":
case t == "sticker" || t == "voice":
item, _, err = getItemData(
client,
fileUrl,
@ -1065,6 +1065,17 @@ func setAttachment(attachments *tgbotapi.Message, client *v1.MgClient, snd *v1.S
if err != nil {
return err
}
case t == "animation":
item, _, err = getItemData(
client,
fileUrl,
caption,
)
if err != nil {
return err
}
item.Caption = item.ID + ".mp4"
default:
item, err = convertAndUploadImage(
client,

View File

@ -39,7 +39,6 @@ audio: "[audio file]"
contact: "[contact]"
document: "[document]"
location: "[location]"
animation: "[animation]"
video: "[video]"
voice: "[voice message]"
photo: "[photo]"

View File

@ -40,7 +40,6 @@ audio: "[archivo de audio]"
contact: "[contacto]"
document: "[documento]"
location: "[localidad]"
animation: "[animación]"
video: "[video]"
voice: "[mensaje de voz]"
photo: "[foto]"

View File

@ -39,7 +39,6 @@ audio: "[аудио файл]"
contact: "[контакт]"
document: "[документ]"
location: "[местонахождение]"
animation: "[анимация]"
video: "[видео]"
voice: "[голосовое сообщение]"
photo: "[изображение]"