J
J
jenya77712018-04-07 19:34:10
Node.js
jenya7771, 2018-04-07 19:34:10

Bot resending message?

Hello, there is such a callback

bot.on('callback_query', function (msg) {

  const chatId = msg.from.id;
  const method = msg.data;

  if (method === 'test') {

    const opt = {
      parse_mode: 'HTML',
      disable_web_page_preview: false,
      reply_markup: JSON.stringify({
        resize_keyboard: true,
        one_time_keyboard: true,
        keyboard: [
        [{text: `1`}, {text: `2`}],
        [{text: `3`}, {text: `4`}]
        ]
      })
    }

    bot.sendMessage(chatId, `Выберите тип помещения`, opt);

  }
  if (method === 'stop') {

    console.log('stop')
  }
});

After the test is executed and after the user presses the button, the keyboard disappears as it should, but after 15 seconds this message is again sent from the bot, what could be the matter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ranc58, 2018-04-08
@jenya7771

There was a similar problem, a bot on a python. I was looking for a solution in due time and could not find anything sensible. Added before sending the message del msgand it seems to have stopped.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question