Answer the question
In order to leave comments, you need to log in
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 this
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question