Bot: Creating a Bot

Description Usage Arguments Format Details API Methods Other Methods Examples

View source: R/bot.R

Description

This object represents a Telegram Bot.

Usage

1
2
3
4
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

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

1
2
3
4
5
6
7
8
## 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)

ebeneditos/telegram.bot documentation built on Dec. 2, 2018, 1:18 p.m.