Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Bot

Creating a Bot


Description

This object represents a Telegram Bot.

Usage

Bot(token, base_url = NULL, base_file_url = NULL,
  request_config = NULL)

is.Bot(x)

Arguments

token

The bot's token given by the BotFather.

base_url

(Optional). Telegram Bot API service URL.

base_file_url

(Optional). Telegram Bot API file URL.

request_config

(Optional). Additional configuration settings to be passed to the bot's POST requests. See the config parameter from ?httr::POST for further details.

The request_config settings are very useful for the advanced users who would like to control the default timeouts and/or control the proxy used for HTTP communication.

x

Object to be tested.

Format

An R6Class object.

Details

To take full advantage of this library take a look at Updater.

You can also use its methods snake_case equivalent.

API Methods

answerCallbackQuery

Send answers to callback queries

answerInlineQuery

Send answers to an inline query

deleteMessage

Delete a message

deleteWebhook

Remove webhook integration

editMessageText

Edit a text message

editMessageCaption

Edit a caption

editMessageReplyMarkup

Edit the reply markup of a message

forwardMessage

Forward messages of any kind

getFile

Prepare a file for downloading

getMe

Check your bot's information

getUpdates

Receive incoming updates

getUserProfilePhotos

Get a user's profile photos

getWebhookInfo

Get current webhook status

leaveChat

Leave a chat

sendAnimation

Send animation files

sendAudio

Send audio files

sendChatAction

Send a chat action

sendDocument

Send general files

sendLocation

Send point on the map

sendMessage

Send text messages

sendPhoto

Send image files

sendSticker

Send a sticker

sendVideo

Send a video

sendVideoNote

Send video messages

sendVoice

Send voice files

setWebhook

Set a webhook

Other Methods

clean_updates

Clean any pending updates

set_token

Change your bot's auth token

Examples

## Not run: 
bot <- Bot(token = "TOKEN")

# In case you want to set a proxy (see ?httr:use_proxy)
bot <- Bot(
  token = "TOKEN",
  request_config = httr::use_proxy(...)
)

## End(Not run)

telegram.bot

Develop a 'Telegram Bot' with R

v2.4.0
GPL-3
Authors
Ernest Benedito [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.