shurillu / CTBot

A simple (and easy to use) Arduino Telegram BOT Library for ESP8266/ESP32
MIT License
147 stars 34 forks source link

How to check for new messages only? #76

Open 20flint12 opened 3 years ago

20flint12 commented 3 years ago

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?

shurillu commented 3 years ago

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