reo7sp / tgbot-cpp

C++ library for Telegram bot API
http://reo7sp.github.io/tgbot-cpp
MIT License
996 stars 239 forks source link

event onAnyMessage alway get old message received when first time run #223

Open ductai230894 opened 2 years ago

ductai230894 commented 2 years ago

Hello sir, I have problem with onAnyMessage, when I run, It always get old message first, any way to prevent this

llnulldisk commented 2 years ago

Hello, what exactly do you mean? A user writes several messages while the bot is offline. Then the bot is started and the messages are received from old to new with onAnyMessage(). You want to receive the latest messages first?

ductai230894 commented 2 years ago

No, this message already read by bot, but when run start again, bot continue read this message, this is old message, I test with listen message from channel, maybe I'm wrong, but bot always read old message which Bot already read it

llnulldisk commented 2 years ago

This shouldn't happen. Do you have any example code to reproduce this problem?

ductai230894 commented 2 years ago

this is example code, bot is admin in channel, bot already read message in channel, but when I run application again, bot continue read this message, I don't know why.. wait me 30 minute, I will capture video

miannoodle01 commented 1 year ago

above of while (1) { longpoll.start() } write this bot.getApi().deleteWebhook();