Handling commands
Handler
class to handle Telegram commands.
CommandHandler(command, callback, filters = NULL, pass_args = FALSE, username = NULL)
command |
The command or vector of commands this handler should listen for. |
callback |
The callback function for this handler.
See |
filters |
(Optional). Only allow updates with these filters. See
|
pass_args |
(Optional). Determines whether the handler should be passed
|
username |
(Optional). Bot's username, you can retrieve it from
|
An R6Class
object.
## Not run: # Initialize bot bot <- Bot("TOKEN") username <- bot$getMe()$username updater <- Updater(bot = bot) # Add a command start <- function(bot, update) { bot$sendMessage( chat_id = update$message$chat_id, text = "Hi, I am a bot!" ) } updater <- updater + CommandHandler("start", start, username = username) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.