Answer the question
In order to leave comments, you need to log in
How to make response to node-telegram-bot-api request?
when I do this, the response comes
bot.onText(/\/echo (.+)/, function (msg, match) {
var chatId = msg.from.id; // Получаем ID отправителя
var resp = match[1]; // Получаем текст после /echo
bot.sendMessage(chatId, resp);
});
bot.onText(/\/echo (.+)/, function (msg, match) {
var chatId = msg.from.id; // Получаем ID отправителя
var resp = match[1]; // Получаем текст после /echo
var answer = 'пока!'
bot.sendMessage(chatId, resp, answer);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question