From ee932a9f8e37716e8e401389a083c2aeecbf4efa Mon Sep 17 00:00:00 2001 From: Daniil Suvorov Date: Sat, 23 Apr 2022 00:37:09 +0300 Subject: Fix UploadMessagesPhoto for vk community chat (vk) (#1812) --- bridge/vk/vk.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bridge/vk/vk.go b/bridge/vk/vk.go index 3e73b9a2..7faa5b40 100644 --- a/bridge/vk/vk.go +++ b/bridge/vk/vk.go @@ -64,7 +64,7 @@ func (b *Bvk) Connect() error { go func() { err := b.lp.Run() if err != nil { - b.Log.Fatal("Enable longpoll in group management") + b.Log.WithError(err).Fatal("Enable longpoll in group management") } }() @@ -223,7 +223,7 @@ func (b *Bvk) uploadFiles(extra map[string][]interface{}, peerID int) (string, s } a, err := b.uploadFile(fi, peerID) if err != nil { - b.Log.Error("File upload error ", fi.Name) + b.Log.WithError(err).Error("File upload error ", fi.Name) } attachments = append(attachments, a) @@ -237,7 +237,8 @@ func (b *Bvk) uploadFile(file config.FileInfo, peerID int) (string, error) { photoRE := regexp.MustCompile(".(jpg|jpe|png)$") if photoRE.MatchString(file.Name) { - p, err := b.c.UploadMessagesPhoto(peerID, r) + // BUG(VK): for community chat peerID=0 + p, err := b.c.UploadMessagesPhoto(0, r) if err != nil { return "", err } -- cgit v1.2.3