0

How to know if the user blocks the chat bot

Oscar Rodriguez 7 years ago 0

Hi all,

I want to know if the user blocks the chat bot. Going through the documentation I didn’t find a way to do it, so I had to create a work around.

I send a message to the user and create a flag of sending; then I use the sleep function for 10 seconds. Every time a user receives a message my code change the flag from sending to send. After 10 seconds, if the flag is still on sending means that the receiver didn’t get the message, so I infer that the chat bot is blocked.

There are some flaws with this work around like if the message takes more than 10 seconds to arrive and I don’t know why if I use the sleep function for >15 seconds, I get into a loop, and the Fb API start sending me requests.

Someone has a better solution??

I appreciate your help! (:

Best,