Text_Bot.Rd
This function sends Text messages from R to your phone. This function assumes you have added a bot from Telegram on your phone, noted the Token and added it to the Add_Bot(Token) file. You should have received a confirmation sms after doing this successfully. See ?Add_Bot for information on this. Alternatively, you could simply include your Token and ID as arguments below, but the Add_Bot function will make managing sending messages much simpler. The default location for the bot's saved information is: path.expand("~") (Type this in your console to see the location). If you overrode this, add the Bot's name and the location in the parameters below. Otherwise, add the Token and ID below.
Text_Bot(Msg, Bot_Name = NULL, Info_Loc = NULL, Token = NULL, Silent = TRUE)
Msg | Message to send to your phone from R. |
---|---|
Bot_Name | Name of the bot to do the sending. |
Info_Loc | Where the RDS file with your needed bot info is saved. Defaults to path.expand("~") |
Token | Token of your bot if not using the saved file call from Rbot::Add_Bot() |
Silent | Choose to not print successful execution. Defaults to TRUE. |
Bot message sent
# NOT RUN { Msg <- "Starting to run routine now...." Bot_Name <- "Soldier1" Text_Bot(Msg = Msg, Bot_Name = Bot_Name) # assume default location # If you used another Add_Bot location: Text_Bot(Msg = Msg, Bot_Name = Bot_Name, Info_Loc = SOME_PATH) # If you prefer setting the Token and ID directly here: Text_Bot(Msg = Msg, Token = TOKEN, ID = Chat_ID) # }