CTBot icon indicating copy to clipboard operation
CTBot copied to clipboard

How to check for new messages only?

Open 20flint12 opened this issue 4 years ago • 1 comments

How to check for new messages without deleting them? Something like myBot.checkNewMessage(msg) If several clients are connected to the bot. The client to whom the message is intended should delete it.

Can you implement that?

20flint12 avatar Feb 11 '21 09:02 20flint12

Hello 20flint12, I'm not sure if it is allowed by Telegram (checking a bot from several clients). BTW there is a new version in the v3.0.0 branch, check it out. If you install that library, you can use the getNewMessage() method with another optional message mode:

CTBotGetMessageNoOption            - no blocking, no destructive
CTBotGetMessageDestructuve         - once read, the message is no more retrieved
CTBotGetMessageBlocking            - wait until a Telegram Server response
CTBotGetMEssageBlockingDestructive - the sum of the two effects

This should be the functionalities that you asked for. Please let me know if it works. Cheers,

Stefano

shurillu avatar Feb 13 '21 22:02 shurillu