Answer the question
In order to leave comments, you need to log in
How to implement sending messages to a specific conversation?
I can't implement sending messages from users to a separate conversation. Here is the script
cmd.hear(/^(?:репорт|report|rep|жалоба|вопрос)\s?([^]+)?/i, async (message, args, bot) => {
if(message.chat) return message.send(`Обращаться в репорт можно только в ЛС ${config.group_url}`);
if(!message.args[1]) return message.send(` » вы не написали жалобу | репорт [текст]`);
for(i=0;i<25000;i++){
if(users[i]){
if(users[i].settings.adm >= 1){
vk.api.call("messages.send", {
peer_id: users[i].id,
message: ` » [REPORT]\n » ID игрока: ${message.user.uid}\n » Жалоба: ${message.args[1]}\n » [Для ответа: ответ [ID] [TEXT]`
}).then((res) => {}).catch((error) => {console.log('report error'); });
}
}
}
return message.send(` » Вы успешно отправили жалобу.`);
});
Answer the question
In order to leave comments, you need to log in
peer_id should be peer_id , not users.id . In the VK Api documentation, read the difference, for example, in the messages.send method
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question