The question is as short as possible. I need that when a user blocks my bot, it will be removed from the Database. the bot is written in python telebot library or PyTelegramBotApi

Telegram does not have a specific method to check if a bot is blocked by a user. Can be checked through user interaction methods. For example, send him a message, if the message is sent -the status code is 200, otherwise 403. Here is the response body: {"ok": false, "error_code": 403, "description": "Forbidden: bot was blocked by the user" }

Volkodaff2021-11-10 13:14:36

Quite right, this answer comes out to the terminal, I need that when this answer comes out to the terminal, the user is removed from the database

mafa2021-11-10 13:50:00

You have not specified which database you are using. Study the documentation for your database and examine the structure of the existing database. And remove the line associated with the user

Volkodaff2021-11-10 16:01:36

i use SQL, how to delete i know i need it to be all automated

mafa2021-11-10 16:32:46