atipugin / telegram-bot-ruby

Ruby wrapper for Telegram's Bot API
https://core.telegram.org/bots/api
Do What The F*ck You Want To Public License
1.36k stars 223 forks source link

Loop Error "403 - Bot was blocked by the user" #58

Closed cippaciong closed 1 year ago

cippaciong commented 8 years ago

Hello, I've got a problem with my bot described by this scenario:

  1. The bot is inactive on my server (nothing is running).
  2. I send a message to my bot (like /start) and then i stop it (block) through Android Telegram.
  3. I start the bot on the server.
  4. The bot gets the /start request, sends its reply and of course it receives a "403 Bot was blocked by the user" error.
  5. The /start request is not removed from getUpdates and the bot keeps getting the 403 error in a loop.

I reported the error to the BotSupport channel and they told to increase the offset by 1 to solve the issue but looking at the gem code it seems that the offset variable is not exposed by any method (am I wrong?)

How can I solve this problem? Is there a way to handle the exception with a retry increasing the offset at the same time?

(might be related to #29 )

leocabeza commented 8 years ago

Did anybody find any solution for this? retry is not working for me, and my bot keeps crashing

chriso0710 commented 7 years ago

Same problem here. Started to happen a few hours ago. My Bot crashed right after starting with

Exception: Telegram::Bot::Exceptions::ResponseError: Telegram API has returned the error. (ok: "false", error_code: "403", description: "Forbidden: Bot was blocked by the user")

chriso0710 commented 7 years ago

Additional info: As mentioned in #29, rescuing the error and retry seems to work for me, for now...

LathaVoggu commented 6 years ago

Even i have same problem, for few user my bot is responding with this error "Unexpected error org.telegram.telegrambots.exceptions.TelegramApiRequestException: Error sending message: [403] Forbidden: bot was blocked by the user at org.telegram.telegrambots.api.methods.send.SendMessage"

Gregory280 commented 2 years ago

Someone blocked the my bot and now does work anymore. I add the rescue statement for the error but now it takes ages to respond to the command. Before that the bot would respond within 15s. Now it takes almost a minute.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.