if (FALSE) {
# Initialize bot
bot <- Bot("TOKEN")
username <- bot$getMe()$username
updater <- Updater(bot = bot)
# Add a command
start <- function(bot, update) {
bot$sendMessage(
chat_id = update$message$chat_id,
text = "Hi, I am a bot!"
)
}
updater <- updater + CommandHandler("start", start, username = username)
}
Run the code above in your browser using DataLab