MessageHandler {telegram.bot} | R Documentation |
Handling messages
Description
Handler
class to handle Telegram messages. They might contain
text, media or status updates.
Usage
MessageHandler(callback, filters = NULL)
Arguments
callback |
The callback function for this handler.
See |
filters |
(Optional). Only allow updates with these filters. Use
|
Format
An R6Class
object.
Examples
## Not run:
callback_method <- function(bot, update) {
chat_id <- update$message$chat_id
bot$sendMessage(chat_id = chat_id, text = "Hello")
}
# No filtering
message_handler <- MessageHandler(callback_method, MessageFilters$all)
## End(Not run)
[Package telegram.bot version 3.0.0 Index]