telegram.bot | R Documentation |
Provides a pure interface for the Telegram Bot API. In addition to the pure API implementation, it features a number of tools to make the development of Telegram bots with R easy and straightforward, providing an easy-to-use interface that takes some work off the programmer.
In this page you can learn how to build a Bot quickly with this package.
Updater
Package main class. This class,
which employs the class Dispatcher
, provides a
front-end to class Bot
to the programmer, so they can
focus on coding the bot. Its purpose is to receive the updates from
Telegram and to deliver them to said dispatcher.
Bot
This object represents a Telegram Bot.
Dispatcher
This class dispatches all kinds of updates to its registered handlers.
Handler
The base class for all update handlers.
Maintainer: Ernest Benedito ebeneditos@gmail.com
Other contributors:
Chris Stefano virtualstaticvoid@gmail.com [contributor]
Useful links:
Report bugs at https://github.com/ebeneditos/telegram.bot/issues
## Not run: 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("TOKEN") + CommandHandler("start", start) updater$start_polling() # Send '/start' to the bot ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.