Add_Bot: Add_Bot

Description Usage Arguments Value Examples

View source: R/Add_Bot.R

Description

Adds all the needed information of a new bot. When using this function, required information is saved to a RDS file, with the same name as your bot. The default path is path.expand("~"), but this can be overridden by setting path below. The steps are outlined below before using this function: First, add a bot from the Telegram app on your phone. Then send to Botfather: '/newbot' After this, follow instructions - adding first a name for your bot (remember this one), and also a username for your bot (ending in _bot). Botfather will also give you a Token, the validity of which can be checked by typing into a browser: https://api.telegram.org/bot<YOURTOKEN>/getMe Save this Token (this is the input to the function Add_Bot). If the browser does not give you an error message, it is a valid bot. It should also show you the bot name and bot username. After getting the Token, you must awake your bot by typing /start. You will see the new bot as part of your contacts. Lastly, send your bot a message from your phone (to initiate conversation with your bot. Simply type: 'Hello!') You are now ready to add this bot to your worker bots... Run: Add_Bot(Token)

Usage

1
Add_Bot(Token, Bot_Name = NULL, Info_Loc = NULL, Silent = FALSE)

Arguments

Token

Add the Token provided by the Botfather from the Telegram app on your website.

Bot_Name

Default is to use the bot's name given to the botfather. This will also be the name of the RDS file with your bots' information saved in.

Info_Loc

Where the RDS file with your needed bot info is saved. Defaults to path.expand("~")

Silent

Choose to not print successful execution. Defaults to TRUE.

Value

RDS file saved with the needed bot information. The printed message after running the function will give the location of the file.

Examples

1
2
3
4
5
## Not run: 
Token <- "12389798751:ASFBVAdaS12408752"
Add_Bot(Token)

## End(Not run)

Nicktz/Rbot documentation built on June 5, 2021, 9:16 a.m.