S
S
scriptnet hello2020-04-30 21:11:19
In contact with
scriptnet hello, 2020-04-30 21:11:19

How to get the id of the user, in response to which the current message was sent?

Tried like this
cmd.on(/^(?:test)$/i, async (message, bot) => {
console.log(message.fwd_messages)
})
But it sends undefined
I want to make the type like this5eab167209321200808490.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladlen Hellsite, 2020-05-01
@scriptnet

cmd.on(/^(?:test)$/i, async (message, bot) => {
    let senderId;

    // Если ответ на сообщение
    if (message.hasReplyMessage) {
        senderId = message.replyMessage.senderId;
    // Если пересланное сообщение
    } else if (message.hasForwards) {
        senderId = message.forwards[0].senderId;
    }
    
    console.log('senderId', senderId)
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question