T
T
tarasovsavely2020-06-03 19:37:26
Node.js
tarasovsavely, 2020-06-03 19:37:26

Node telegram bot api How to get the id of the poll (message) sent by the bot?

Another question arose during attempts to develop a telegram bot. How can I get the id of the poll (or any message) sent by the bot?
I tried this (because the documentation says that information about the sent survey is returned) - console.log (bot.sendPoll (...));
The survey is sent, but some pirsome is displayed in the console, instead of information about the sent survey. I understand that messages are sent in asynchronous mode and that you need to wait for a response from this piersome, but I can't do it. Tell me, please, how is it possible to do this (preferably without completely stopping the program)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stockholm Syndrome, 2020-06-03
@StockholmSyndrome

bot.sendPoll(...).then((data) => {
  console.log(data);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question