R/start_bot.R

Defines functions start_bot

Documented in start_bot

#' start the telegram chatbot
#'
#' @param token your telegram bot api token
#' @param ... answers and commands
start_bot<-function(token,...){
  updater<-telegram.bot::Updater(token)
  handlers<-list(...)

  for(handler in handlers){
    updater = updater + handler
  }
  updater = updater + telegram.bot::ErrorHandler(error_callback)
  updater$start_polling()

}
mabafaba/telegramchatbot documentation built on Jan. 4, 2021, 12:33 a.m.