In general, the problem is this: I need to give the user his ID in the message. How can this be implemented?
I use node-telegram-bot-api. I tried this:
var idforuser = bot.user_id; bot.on('message', (msg) => { if (msg.text.toLowerCase() === "мой айди"){ bot.sendMessage(msg.chat.id, "Это твой айди - " + idforuser, menu) } }); But with the execution of the issue: "Here is your ID - undefined".