Answer the question
In order to leave comments, you need to log in
The bot has an error when sending Node js. what should I do?
I write "mailing Bot is working successfully" but the mailing does not send anything to anyone in the console, that's what
Here is the code!
senya.her(/^(?:рассылка)\s([^]+)/i, async (message) => {
if(message.user.polnom < 12)
return;
let group_token = `e95c646c9b61ccfa5ebe71d19c4cc414b5704631e8ffb56d3e17ee2aa687bcefe77f799071c5456ff3b9f`;
let rs = new VK({ token: group_token });
try
{
let dialogs = await rs.api.messages.getConversations({count: 200, offset: 0});
for(i in dialogs.items)
{
rs.api.messages.send({
peer_id: dialogs.items[i].conversation.peer.id,
attachment: `${wall_post}`,
message: `${message.args[1]}`,
keyboard:JSON.stringify({
"inline": true,
"buttons":
})
});
}
for(var i = 1; i < 500; i++)
{
rs.api.messages.send({
chat_id: i,
attachment: `${wall_post}`,
message: `${message.args[1]}`,
keyboard:JSON.stringify({
"inline": true,
"buttons":
})
});
}
return message.send(' рассылка будет отправлена в течении нескольких секунд...')
}
catch (e)
{
console.log(`ошибка.`)
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question