Preferably without get_updates () [- 1]. Python
1 answer
There are several libraries for working with telegrams for python. Not knowing which one you use will answer in general. The Telegram API provides the messages.sendMessage method, which returns data about the message sent. Among these data including the ID of the sent message.
Most likely the library you are using also returns this data. Then the code will be like this:
res = bot.sendMessage(chatId, "текст сообщения") print(res.id) |