zachkont / dotaUpdatesBot

A telegram bot for dota2 updates
GNU General Public License v3.0
23 stars 23 forks source link

Remove invalid subscribers #24

Open zachkont opened 6 years ago

zachkont commented 6 years ago

When a user has blocked the bot or a group has removed it without unsubscribing, the telegram API returns: 2017-11-08 14:52:30,194 (updater.py:82 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 403 Forbidden. Response body: [{"ok":false,"error_code":403,"description":"Forbidden: bot was blocked by the user"}]" and: 2017-11-08 14:52:31,062 (updater.py:90 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 403 Forbidden. Response body: [{"ok":false,"error_code":403,"description":"Forbidden: bot was kicked from the group chat"}]" respectively. It would be best if in such cases the corresponding users/groups where removed from the subscribers list

zachkont commented 6 years ago

Two more error checks related to this:

[{"ok":false,"error_code":400,"description":"Bad Request: group chat was migrated to a supergroup chat","parameters":{"migrate_to_chat_id":-xxxxxx}}]" 2018-02-09 01:32:51,302 (updater.py:112 MainThread) 
[{"ok":false,"error_code":400,"description":"Bad Request: chat not found"}]"
mathagician commented 6 years ago

@zachkont please close the issue if resolved

zachkont commented 6 years ago

@mathagician the error codes mentioned in my previous comment are not being handled currently