Learn R Programming

telegram.bot (version 1.0.0)

Updater: Updater

Description

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. The dispatcher supports Handler classes for different kinds of data: Updates from Telegram, basic text commands and even arbitrary types.

Usage

Updater(token = NULL, bot = NULL)

Arguments

token

(Optional). The bot's token given by the @BotFather.

bot

(Optional). A pre-initialized Bot instance.

Format

An R6Class object.

Methods

start_polling

Starts polling updates from Telegram.

stop_polling

Stops the polling.

Details

Note: You must supply either a bot or a token argument.

References

Bots: An introduction for developers and Telegram Bot API

Examples

Run this code
# NOT RUN {
updater <- Updater(token = 'TOKEN')
# }

Run the code above in your browser using DataLab