Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

add_error_handler

Add an error handler


Description

Registers an error handler in the Dispatcher.

Usage

add_error_handler(callback)

Arguments

callback

A function that takes (bot, error) as arguments.

Details

You can also use add_handler to register error handlers if the handler is of type ErrorHandler.

Examples

## Not run: 
updater <- Updater(token = "TOKEN")

# Create error callback
error_callback <- function(bot, error) {
  warning(simpleWarning(conditionMessage(error), call = "Updates polling"))
}

# Register it to the updater's dispatcher
updater$dispatcher$add_error_handler(error_callback)
# or
updater$dispatcher$add_handler(ErrorHandler(error_callback))
# or
updater <- updater + ErrorHandler(error_callback)

## End(Not run)

telegram.bot

Develop a 'Telegram Bot' with R

v2.4.0
GPL-3
Authors
Ernest Benedito [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.