Answer the question
In order to leave comments, you need to log in
How can I make it so that when I do a mailing list, the mailing list message is sent to all the people who have ever written to the group?
Just no idea how to organize it. I hope for your help.
Answer the question
In order to leave comments, you need to log in
const { VK, createCollectIterator, getRandomId } = require(`vk-io`);
const vk = new VK({
token: "",
});
(async function () {
const iterator = createCollectIterator({
api: vk.api,
method: "messages.getConversations",
params: {},
countPerRequest: 200,
});
for await (const chunk of iterator) {
for (let element of chunk.items) {
if (element.conversation.peer.type === `user`) {
// Send message
/*
vk.api.messages.send({
message: "Test",
peer_id: element.conversation.peer.id,
random_id: getRandomId(),
});
*/
}
}
}
})();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question