tgbot-cpp icon indicating copy to clipboard operation
tgbot-cpp copied to clipboard

event onAnyMessage alway get old message received when first time run

Open ductai230894 opened this issue 2 years ago • 5 comments

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

ductai230894 avatar Sep 02 '22 03:09 ductai230894

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?

llnulldisk avatar Sep 02 '22 11:09 llnulldisk

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

ductai230894 avatar Sep 02 '22 12:09 ductai230894

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

llnulldisk avatar Sep 02 '22 12:09 llnulldisk

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

ductai230894 avatar Sep 02 '22 12:09 ductai230894

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

miannoodle01 avatar Jan 26 '23 21:01 miannoodle01