How I wiped out ~3% of my users

Here are two types of errors you could receive while trying to send a message from a telegram bot to somebody:

  1. {ok: "false", error_code: "403", description: "Forbidden: bot was blocked by the user"}
  2. {ok: "false", error_code: "403", description: "Forbidden: bot can't send messages to the user"}

To receive the first error, you just need to block your own bot by pressing the "block user" button. Easy.

What am I doing in this case? Well, since my bot is doing a lot of background work for subscribers, I'm just removing all the subscriptions the user has to save some resources and stop messaging them further.

To receive the second error, you need to send messages to users all day all for a couple of years, until one day the Telegram itself passes into some strange state where it answers to your messages with this error. Just for a couple of minutes. And then it works fine again.

How could I know these are two different errors? Well, I couldn't. Until now. Thanks to me writing everything down in the log.

There is a thing in a programmers' world called "specification". Basically there should be a list of error messages with a description of their purpose. But it doesn't exist for Telegram bot api.

If you even try to google the second message, you'll probably end up on this page again.

TL;DR: not my fault, Telegram sucks.