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