TGBot | R Documentation |
Package main class (implementing the Telegram bot).
An R6Class
generator object.
forwardMessage
forward messages of any kind
getFile
get info about a file and download it
getMe
test your bot's auth token
getUpdates
receive incoming updates
getUserProfilePhotos
get a list of profile pictures for a user
sendAudio
send mp3
files
sendDocument
send general files
sendLocation
send point on the map
sendMessage
send text messages
sendPhoto
send image files
sendSticker
send .webp
stickers
sendVideo
send mp4
videos
sendVoice
send ogg files encoded with OPUS
sendPoll
send a telegram poll
stopPoll
stop a telegram poll and obtain results
new()
TGBot$new(token, proxy)
set_token()
TGBot$set_token(token)
set_proxy()
TGBot$set_proxy(proxy)
set_default_chat_id()
TGBot$set_default_chat_id(chat_id)
req()
TGBot$req(method = NULL, body = NULL)
last_request()
TGBot$last_request()
print()
TGBot$print()
forwardMessage()
TGBot$forwardMessage( from_chat_id = NULL, message_id = NULL, disable_notification = NULL, chat_id = NULL )
getFile()
TGBot$getFile(file_id, destfile = NULL)
getMe()
TGBot$getMe()
getUpdates()
TGBot$getUpdates(offset = NULL, limit = NULL)
getUserProfilePhotos()
TGBot$getUserProfilePhotos(user_id = NULL, offset = NULL, limit = NULL)
sendAudio()
TGBot$sendAudio( audio = NULL, caption = NULL, duration = NULL, performer = NULL, title = NULL, disable_notification = NULL, reply_to_message_id = NULL, chat_id = NULL )
sendChatAction()
TGBot$sendChatAction(action = NULL, chat_id = NULL)
sendDocument()
TGBot$sendDocument( document = NULL, disable_notification = NULL, reply_to_message_id = NULL, chat_id = NULL )
sendLocation()
TGBot$sendLocation( latitude = NULL, longitude = NULL, disable_notification = NULL, reply_to_message_id = NULL, chat_id = NULL )
sendMessage()
TGBot$sendMessage( text = NULL, parse_mode = NULL, disable_web_page_preview = NULL, disable_notification = NULL, reply_to_message_id = NULL, chat_id = NULL )
sendPhoto()
TGBot$sendPhoto( photo = NULL, caption = NULL, disable_notification = NULL, reply_to_message_id = NULL, chat_id = NULL )
sendSticker()
TGBot$sendSticker( sticker = NULL, disable_notification = NULL, reply_to_message_id = NULL, chat_id = NULL )
sendVideo()
TGBot$sendVideo( video = NULL, duration = NULL, caption = NULL, reply_to_message_id = NULL, chat_id = NULL )
sendVoice()
TGBot$sendVoice( voice = NULL, duration = NULL, disable_notification = NULL, reply_to_message_id = NULL, chat_id = NULL )
sendDice()
TGBot$sendDice(disable_notification = NULL, chat_id = NULL)
sendPoll()
TGBot$sendPoll( question = NULL, options = NULL, is_anonymous = TRUE, type = c("regular", "quiz"), allows_multiple_answers = FALSE, correct_option_id = NULL, is_closed = FALSE, disable_notification = NULL, reply_to_message_id = NULL, chat_id = NULL )
stopPoll()
TGBot$stopPoll(message_id = NULL, chat_id = NULL)
clone()
The objects of this class are cloneable with this method.
TGBot$clone(deep = FALSE)
deep
Whether to make a deep clone.
Bots: An introduction for developers and Telegram Bot API
## Not run:
## Without proxy
bot <- TGBot$new(token = bot_token('RBot'))
## With a proxy ...
prx <- list('url' = '123.45.6.78',
'port' = 8080,
'username' = 'user',
'password' = 'password')
bot <- TGBot$new(token = bot_token('RBot'), proxy = prx)
## .. or
bot <- TGBot$new(token = bot_token('RBot'))
bot$set_proxy(proxy = prx)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.