Answer the question
In order to leave comments, you need to log in
VK-IO: how to send an image to a group conversation?
In normal conversations, the context.sendPhotos(photo) method works without problems, but in group conversations, I get an "Unknown error occurred" error in response. How can I fix it?
Answer the question
In order to leave comments, you need to log in
const { VK } = require('vk-io');
const vk = new VK({
token: config.vkToken,
pollingGroupId: config.vkGroupId
});
vk.upload
.messagePhoto({
source: buffer, //картинка, в моём случае из буффера
})
.then((attachment) =>
vk.api.messages.send({
message: text_message, //сообщение
attachment,
peer_id: 2000000003, // id беседы
})
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question