From 5e132e935008682b601f4f4726a917ee2eefc6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D0=B1=D0=B5=D0=BB=D0=B5=D0=B2=20=D0=90=D0=BD?= =?UTF-8?q?=D0=B4=D1=80=D0=B5=D0=B9=20=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B5?= =?UTF-8?q?=D0=B2=D0=B8=D1=87?= Date: Fri, 26 May 2023 11:38:52 +0300 Subject: [PATCH] change api methods --- plugin.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugin.go b/plugin.go index 7140802..a7bceed 100644 --- a/plugin.go +++ b/plugin.go @@ -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