Learn R Programming

telegram.bot (version 3.0.0)

bot_token: Get a token from environment

Description

Obtain token from system variables (in .Renviron) set according to the naming convention R_TELEGRAM_BOT_X where X is the bot's name.

Usage

bot_token(bot_name)

Arguments

bot_name

The bot's name.

Examples

Run this code
if (FALSE) {
# Open the `.Renviron` file
file.edit(path.expand(file.path("~", ".Renviron")))
# Add the line (uncomment and replace  by your bot TOKEN):
# R_TELEGRAM_BOT_RTelegramBot=
# Save and restart R

bot_token("RTelegramBot")
}

Run the code above in your browser using DataLab