GithubHelp home page GithubHelp logo

asharijuang / telegrambot-library Goto Github PK

View Code? Open in Web Editor NEW

This project forked from casajasmina/telegrambot-library

0.0 2.0 0.0 43 KB

Host a Telegram Bot on your Arduino, and interact with it from your favourite chat application

License: GNU Lesser General Public License v2.1

C++ 100.00%

telegrambot-library's Introduction

TelegramBot Library

A project by Casa Jasmina

Introduction

This library allows you to host a Telegram Bot on your Arduino, and interact with telegram bot API.

It works on [Arduino/Genuino MKR1000] (http://www.arduino.cc/en/Main/ArduinoMKR1000), and on Arduino Zero with the WiFi shield 101.

Installing

The library can be installed from the library manager or added manually selecting the menu:

 Sketch / include Library / Add .Zip library

You also have to install the ArduinoJson library written by Benoît Blanchon. Available here.

Getting started

View the last released Telegram API documentation at: https://core.telegram.org/bots/api.

To generate your new Bot, you need an Access Token. Talk to BotFather and follow a few simple steps described here.

For full details, see "Bots: An introduction for developers".

Api Reference

TelegramBot(const char* token, Client &client);
String sendMessage(String chat_id, String my_text);
String sendMessage(String chat_id, String my_text, Keyboard keyboard, bool one_time_keyboard = true, bool resize_keyboard = true);
String postMessage(String msg);
message getUpdates();
struct message{
  const char* text;
  const char* chat_id;
  const char* sender;
  const char* date;
};

Groups implementation

When the bot is included in a group it will be, by default, in privacy mode. Which means that it will receive only messages starting with "/", the so called commands. In order to disable the privacy mode you have to chat with BotFather and use this commands:

/mybots
@yourBot
Bot setting
Group privacy
Turn off

You can also create your own list of commands using /setcommands while chatting with the BotFather. This list will appear only in the mobile view, pressing the "/" icon.

Reliability

In the long run we recommend to use a watchdog. If you are using the library Adafruit sleepy dog in its 1.1.1 (or later) version, you have also to download the Adafruit_ASFcore library.

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 library) can only be redistributed under LGPL-3, but applications that use the library don't have to be.

telegrambot-library's People

Contributors

tommasoltrz avatar lorenzoromagnoli avatar facchinm avatar

Watchers

James Cloos avatar Ashari Juang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.