P
P
Perokar2021-12-10 13:23:12
Node.js
Perokar, 2021-12-10 13:23:12

Polling:true disabled in Telegram Api?

Greetings, I can't figure out why polling:true doesn't work.
already trimmed the code (for testing) and still doesn't work:

require('dotenv').config('')
const token = process.env.TOKEN || тут указан токен но вам оно не надо
const uri = process.env.URI;
const TelegramApi = require('node-telegram-bot-api');
const bot = new TelegramApi(token, { polling: true });
const keyboardOption ={
  reply_markup: {
    inline_keyboard:
      [
        [
          { text: "Да", callback_data: '1' },
          { text: "Нет", callback_data: '0' }
        ]
      ]
  }
}
bot.on("message", async (msg, prop) => {
bot.sendMessage (msg.from.id, 'blablabla', keyboardOption);}
bot.on("callback_query", msg=>console.log(msg));


The message with the buttons comes, there is no reaction to pressing the buttons. I have already tried skipping buttons, through JSON.stringify . - no difference, the buttons come, and silence.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question