Answer the question
In order to leave comments, you need to log in
How to make VK JS mailing work?
Guys, help, please, I don’t understand what I’m doing wrong, I want to understand how to make a newsletter in VK JS.
cmd.hear(/^(?:рассылка)\s([^]+)$/i, async (message, bot) => {
if(message.user.settings.adm < 4) return;
users.filter(x=> x.id !== 1).map(zz => {
vk.api.messages.send({ user_id: zz.id, message: `${message.args[1]}`});
});
let people = 0;
bot(`рассылка отправлена!`);
for(let id in users) {
vk.api.call('messages.send', {
chat_id: id,
message: `${message.args[1]}` });
}
return;
});
Answer the question
In order to leave comments, you need to log in
cmd.hear(/^(?:рассылка)\s([^]+)$/i, async (message, bot) => {
if(message.user.settings.adm < 4) return;
for (let i = 0;i<users.length;i++) {
if(users[i]) vk.api.messages.send({ peer_id: users[i].id, message: `${message.args[1]}`});
};
let people = 0;
bot(`рассылка отправлена!`);
return;
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question