I
I
Ivan2017-10-11 18:43:29
Bots
Ivan, 2017-10-11 18:43:29

How can a Telegram bot check if a user has blocked the bot or not?

The point is.
About 4000 people used my bot, I wanted to do a small mailing with my channel and from the site of articles (+ the command to send off and on - so that a person can disconnect from the mailing), if he does not need to.
I came across a 403 error, the bottom line is that I send it to people who have already blocked my bot. How do you know if he's blocked or not? After all, I want to send it to others, but it falls at the beginning.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Trakhimenok, 2017-10-13
@astec

If you get a 403 error, then it means blocked. Mark this user as inactive in the database and move on to the next user.
How to handle errors depends on your programming language.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question