ebeneditos / telegram.bot

Develop a Telegram Bot with R
https://ebeneditos.github.io/telegram.bot/
GNU General Public License v3.0
107 stars 24 forks source link

HTTP 403 Error #19

Closed tolgakurtuluss closed 2 years ago

tolgakurtuluss commented 2 years ago

Hello everyone!

I was using my basic level bot with telegram.bot library but it started to give this error as given below. I tried to revoke API but didn't work for me.

updater$start_polling() Error in private$request(url, data) : Forbidden (HTTP 403). Called from: httr::stop_for_status(result) Browse[1]>

ebeneditos commented 2 years ago

Hi, could you please share a replicable example to see when that happens? Thanks!

tolgakurtuluss commented 2 years ago

Even though I used the most basic codeblock on the main github page it gives the same error for both on rstudio.cloud environment and my personal computer. Here is a console output regarding to this issue.

` library(telegram.bot)

start <- function(bot, update) {

  • bot$sendMessage(
  • chat_id = update$message$chat$id,
  • text = sprintf("Hello %s!", update$message$from$first_name)
  • )
  • }

updater <- Updater("MYTOKEN") + CommandHandler("start", start)

updater$start_polling() Error in private$request(url, data) : Forbidden (HTTP 403). `

ebeneditos commented 2 years ago

I do not get this error with that same code, did you start the bot from Telegram? Try going to this URL https://api.telegram.org/bot{yourtoken}/get_me replacing your token, if it does not work it's either your token or registration that is not correct.

tolgakurtuluss commented 2 years ago

Thank you for your support. Errors no longer appear when I am running the code.

hfahmy commented 1 year ago

This error will appear if the user block the bot. Is there any way to catch the error @ebeneditos ?