M
M
Maxim Recipient2019-07-01 18:56:55
In contact with
Maxim Recipient, 2019-07-01 18:56:55

How can I get a person's id by forwarding their message in a conversation?

This code reads any message from the user:

cmd.hear(/^(.*)$/i, async (message, bot) => {
  message.user.balance += 1;
});

I would like to know how to make the bot accept forwarded messages and recognize the sender's id. Most likely, you will need VK documentation.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2019-07-01
@sergiks

Depends on the implementation of the bot, the link to which you did not provide, so you can only guess.
But, probably, messageit has the same format as in the VK documentation .
In this case, it message.from_idwill contain the identifier of the sender.
If the message was forwarded, then the original will be somewhere inside the field fwd_messages

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question