change api methods

This commit is contained in:
Кобелев Андрей Андреевич 2023-05-26 11:38:52 +03:00
parent b545186f68
commit 5e132e9350

View File

@ -372,35 +372,35 @@ func (p Plugin) Exec() (err error) {
msg.ParseMode = p.Config.Format
msg.DisableWebPagePreview = p.Config.DisableWebPagePreview
msg.DisableNotification = p.Config.DisableNotification
msg.
if err := p.Send(bot, msg); err != nil {
return err
}
}
for _, value := range photos {
msg := tgbotapi.NewPhotoUpload(user, value)
msg := tgbotapi.NewPhoto(user, tgbotapi.FilePath(value))
if err := p.Send(bot, msg); err != nil {
return err
}
}
for _, value := range documents {
msg := tgbotapi.NewDocumentUpload(user, value)
msg := tgbotapi.NewDocument(user, tgbotapi.FilePath(value))
if err := p.Send(bot, msg); err != nil {
return err
}
}
for _, value := range stickers {
msg := tgbotapi.NewStickerUpload(user, value)
msg := tgbotapi.NewSticker(user, tgbotapi.FilePath(value))
if err := p.Send(bot, msg); err != nil {
return err
}
}
for _, value := range audios {
msg := tgbotapi.NewAudioUpload(user, value)
msg := tgbotapi.NewAudio(user, tgbotapi.FilePath(value))
msg.Title = "Audio Message."
if err := p.Send(bot, msg); err != nil {
return err
@ -408,14 +408,14 @@ func (p Plugin) Exec() (err error) {
}
for _, value := range voices {
msg := tgbotapi.NewVoiceUpload(user, value)
msg := tgbotapi.NewVoice(user, tgbotapi.FilePath(value))
if err := p.Send(bot, msg); err != nil {
return err
}
}
for _, value := range videos {
msg := tgbotapi.NewVideoUpload(user, value)
msg := tgbotapi.NewVideo(user, tgbotapi.FilePath(value))
msg.Caption = "Video Message"
if err := p.Send(bot, msg); err != nil {
return err