botman / driver-telegram

BotMan Telegram Driver
MIT License
86 stars 75 forks source link

Add new exceptions: bot was blocked by the user, chat not found #89

Open antimech opened 3 years ago

antimech commented 3 years ago

It would be cool not to handle such errors manually.

Here is an example of Telegram response after trying to send a message to a user that blocked your bot: HTTP 403

{
  "ok": false,
  "error_code": 403,
  "description": "Forbidden: bot was blocked by the user"
}

Chat doesn't exist (i.e. user doesn't exist): HTTP 400

{
  "ok": false,
  "error_code": 400,
  "description": "Bad Request: chat not found"
}