Answer the question
In order to leave comments, you need to log in
How can I handle vk api error?
In general, there is a code:
vk.api.messages.send({
user_id: msg.senderId,
message: `Я написал в лс`,
forward: JSON.stringify({
peer_id: msg.peerId,
conversation_message_ids: [msg.conversationMessageId]
})
})
APIError: Code №901 - Can't send messages for users without permission
at API.callMethod (C:\Users\user\node_modules\vk-io\lib\index.js:828:39)
at processTicksAndRejections (node:internal/process/task_queues:93:5) {
code: 901,
params: [
{ key: 'method', value: 'messages.send' },
{ key: 'oauth', value: '1' },
{ key: 'v', value: '5.103' },
{ key: 'user_id', value: '641618650' },
{
key: 'forward',
value: '{"peer_id":2000000002,"conversation_message_ids":[7552]}'
},
{ key: 'random_id', value: '64541614530113846' }
]
}
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