Answer the question
In order to leave comments, you need to log in
How to make the bot respond to the message, namely the answer (reply)?
I want a code so that the bot responds specifically to the message, that is, for example, a person writes hello, the bot answers hello but in response to the message, more understandably, reply.
Answer the question
In order to leave comments, you need to log in
From your comments, I understand that you are using the vk-io
library.
Actually, now the code that you apparently need is:
vk.updates.hear(/(?:вопрос)/iu, msg => {
msg.send(`ответ`, {
reply_to: msg.id
});
return;
})
vk.updates.hear(/(?:вопрос)/iu, msg => {
msg.send(`ответ`, {
forward: JSON.stringify({
peer_id: msg.peerId,
conversation_message_ids: [msg.conversationMessageId],
is_reply: 1,
})
});
return;
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question