pass item id as name
This commit is contained in:
parent
46810dab09
commit
2ce3f44898
@ -1056,7 +1056,7 @@ func setAttachment(attachments *tgbotapi.Message, client *v1.MgClient, snd *v1.S
|
|||||||
item := v1.Item{}
|
item := v1.Item{}
|
||||||
fileUrl := fmt.Sprintf("https://api.telegram.org/file/bot%s/%s", botToken, file.FilePath)
|
fileUrl := fmt.Sprintf("https://api.telegram.org/file/bot%s/%s", botToken, file.FilePath)
|
||||||
switch {
|
switch {
|
||||||
case t == "sticker" || t == "voice" || t == "animation":
|
case t == "sticker" || t == "voice":
|
||||||
item, _, err = getItemData(
|
item, _, err = getItemData(
|
||||||
client,
|
client,
|
||||||
fileUrl,
|
fileUrl,
|
||||||
@ -1065,6 +1065,17 @@ func setAttachment(attachments *tgbotapi.Message, client *v1.MgClient, snd *v1.S
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
case t == "animation":
|
||||||
|
item, _, err = getItemData(
|
||||||
|
client,
|
||||||
|
fileUrl,
|
||||||
|
caption,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
item.Caption = item.ID + ".mp4"
|
||||||
default:
|
default:
|
||||||
item, err = convertAndUploadImage(
|
item, err = convertAndUploadImage(
|
||||||
client,
|
client,
|
||||||
|
@ -39,7 +39,6 @@ audio: "[audio file]"
|
|||||||
contact: "[contact]"
|
contact: "[contact]"
|
||||||
document: "[document]"
|
document: "[document]"
|
||||||
location: "[location]"
|
location: "[location]"
|
||||||
animation: "[animation]"
|
|
||||||
video: "[video]"
|
video: "[video]"
|
||||||
voice: "[voice message]"
|
voice: "[voice message]"
|
||||||
photo: "[photo]"
|
photo: "[photo]"
|
||||||
|
@ -40,7 +40,6 @@ audio: "[archivo de audio]"
|
|||||||
contact: "[contacto]"
|
contact: "[contacto]"
|
||||||
document: "[documento]"
|
document: "[documento]"
|
||||||
location: "[localidad]"
|
location: "[localidad]"
|
||||||
animation: "[animación]"
|
|
||||||
video: "[video]"
|
video: "[video]"
|
||||||
voice: "[mensaje de voz]"
|
voice: "[mensaje de voz]"
|
||||||
photo: "[foto]"
|
photo: "[foto]"
|
||||||
|
@ -39,7 +39,6 @@ audio: "[аудио файл]"
|
|||||||
contact: "[контакт]"
|
contact: "[контакт]"
|
||||||
document: "[документ]"
|
document: "[документ]"
|
||||||
location: "[местонахождение]"
|
location: "[местонахождение]"
|
||||||
animation: "[анимация]"
|
|
||||||
video: "[видео]"
|
video: "[видео]"
|
||||||
voice: "[голосовое сообщение]"
|
voice: "[голосовое сообщение]"
|
||||||
photo: "[изображение]"
|
photo: "[изображение]"
|
||||||
|
Loading…
Reference in New Issue
Block a user