niteshdm / telegram.bot

Develop a Telegram Bot with R

Home Page:https://ebeneditos.github.io/telegram.bot/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

telegram.bot

Develop a Telegram Bot with R

Project Status: Active – The project has reached a stable, usable state and is being actively developed. CRAN Travis CI Status AppVeyor Build Status Codecov License

This package features a number of tools to make the development of Telegram bots with R easy and straightforward, providing an easy-to-use interface that takes some work off the programmer. It is built on top of the pure API implementation, being an extension of the telegram package, an R wrapper around the Telegram Bot API.

Installation

You can install telegram.bot from CRAN:

install.packages("telegram.bot")

Or the development version from GitHub:

# install.packages("devtools")
devtools::install_github("ebeneditos/telegram.bot")

Make sure you have the devtools package updated.

Usage

The telegram.bot package is easy, fun and free to use! You can quickly build a chatbot with a few lines:

library(telegram.bot)

hello <- function(bot, update){
  bot$sendMessage(chat_id = update$message$chat_id,
                  text = sprintf("Hello %s!", update$message$from$first_name))
}

updater <- Updater('YOUR TOKEN HERE')

updater$dispatcher$add_handler(CommandHandler('hello', hello))

updater$start_polling()

Getting Started

To get you started with telegram.bot, we recommend to take a look at its Wiki:

You can also check these other resources:

Contributing

The package is in a starting phase, so contributions of all sizes are very welcome. Please:

License

You may copy, distribute and modify the software provided that modifications are described and licensed for free under LGPL-3. Derivatives works (including modifications or anything statically linked to the package) can only be redistributed under LGPL-3, but applications that use the library don't have to be.

Attribution

This package is inspired by Python's library python-telegram-bot, specially by its submodule telegram.ext.

About

Develop a Telegram Bot with R

https://ebeneditos.github.io/telegram.bot/

License:GNU Lesser General Public License v3.0


Languages

Language:R 100.0%