Skip to content

Commit e0756d0

Browse files
committed
Updating Readme
1 parent ef44295 commit e0756d0

File tree

1 file changed

+25
-43
lines changed

1 file changed

+25
-43
lines changed

README.md

Lines changed: 25 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
#Universal Telegram Bot Library
1+
# Universal Telegram Bot Library
22

33
An Arduino IDE library for using Telegram Bot API. It's designed to be used with multiple Arduino architectures.
44

5-
Forked from [ESP8266-TelegramBot](https://github.com/Gianbacchio/ESP8266-TelegramBot) & inspired by [TelegramBot-Library](https://github.com/CasaJasmina/TelegramBot-Library)
6-
5+
Please join the [Telegram Group Chat](https://t.me/arduino_telegram_library) if you like to discuss the library or need any help.
76

87
## Introduction
98

109
This library provides an interface for [Telegram Bot API](https://core.telegram.org/bots/api).
1110

12-
Telegram is a instant messaging app that allows for the creation of bots. Bots can be configured to send and receive messages. This is useful for Arduino projects as you can receive updates from your project or issue it commands via your Telegram app.
11+
Telegram is an instant messaging service that allows for the creation of bots. Bots can be configured to send and receive messages. This is useful for Arduino projects as you can receive updates from your project or issue it commands via your Telegram app from anywhere.
1312

14-
As mentioned, this is a library forked from [one library](https://github.com/Gianbacchio/ESP8266-TelegramBot) and inspired by [another](https://github.com/CasaJasmina/TelegramBot-Library)
13+
This is a library forked from [one library](https://github.com/Gianbacchio/ESP8266-TelegramBot) and inspired by [another](https://github.com/CasaJasmina/TelegramBot-Library)
1514

1615
Each library only supported a single type of Arduino and had different features implemented. The only thing that needs to be different for each board is the actual sending of requests to Telegram so I thought a library that additional architectures or boards could be configured easily would be useful, although this springs to mind:
1716

@@ -26,64 +25,47 @@ The downloaded code can be included as a new library into the IDE selecting the
2625

2726
You also have to install the ArduinoJson library written by [Benoît Blanchon](https://github.com/bblanchon). Search for it on the Arduino Library manager or get it from [here](https://github.com/bblanchon/ArduinoJson).
2827

28+
29+
## Getting Started
30+
31+
To generate your new Bot, you need an Access Token. Talk to [BotFather](https://telegram.me/botfather) and follow a few simple steps described [here](https://core.telegram.org/bots#botfather).
32+
33+
2934
Include UniversalTelegramBot in your project:
3035

3136
#include <UniversalTelegramBot.h>
3237

33-
and pass it a Bot token and a SSL Client (See the examples for more details)
38+
and pass it a Bot token and a SSL Client (See the [examples](https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot/tree/master/examples) for more details)
3439

3540
#define BOTtoken "XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
3641
// WiFiSSLClient client; //For 101 boards
3742
WiFiClientSecure client; //For ESP8266 boards
3843
UniversalTelegramBot bot(BOTtoken, client);
3944

40-
*NOTE:* This library has not been tested with the 101 boards as I do not have a compatible board. If you can help please let me know!
41-
42-
## Getting started
43-
44-
View the last released Telegram API documentation at: https://core.telegram.org/bots/api.
45-
46-
To generate your new Bot, you need an Access Token. Talk to [BotFather](https://telegram.me/botfather) and follow a few simple steps described [here](https://core.telegram.org/bots#botfather).
47-
48-
For full details, see "[Bots: An introduction for developers](https://core.telegram.org/bots)".
45+
*NOTE:* This library has not been tested with the 101 boards as I do not have a compatible board. [If you can help please let us know!](https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot/issues/2)
4946

50-
## --- API ---
47+
## Features
5148

52-
These are the main functions of the library
49+
Here is a list of features that this library covers. (Note: The examples link to the ESP8266 versions)
5350

54-
#### sendMessage
51+
|Feature|Description|Usage|Example|
52+
|--------|-----------|----|-------|
53+
|*Receiving Messages*|Your bot can read messages that are sent to it. This is useful for sending commands to your arduino such as toggle and LED|`int getUpdates(long offset)` <br><br> Gets any pending messages from Telegram and stores them in **bot.messages** . Offset should be set to **bot.last_message_received** + 1. Returns the numbers new messages received.| [FlashLED](https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot/blob/master/examples/ESP8266/FlashLED/FlashLED.ino) or any other example|
54+
|*Sending messages*|Your bot can send messages to any Telegram or group. This can be useful to get the arduino to notify you of an event e.g. Button pressed etc (Note: bots can only message you if you messaged them first)|`bool sendMessage(String chat_id, String text, String parse_mode = "")` <br><br> Sends the message to the chat_id. Returns if the message sent or not.| [EchoBot](https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot/blob/master/examples/ESP8266/EchoBot/EchoBot.ino#L51) or any other example|
55+
|*Reply Keyboards*|Your bot can send [reply keyboards](https://camo.githubusercontent.com/2116a60fa614bf2348074a9d7148f7d0a7664d36/687474703a2f2f692e696d6775722e636f6d2f325268366c42672e6a70673f32) that can be used as a type of menu.|`bool sendMessageWithReplyKeyboard(String chat_id, String text, String parse_mode, String keyboard, bool resize = false, bool oneTime = false, bool selective = false)` <br><br> Send a keyboard to the specified chat_id. parse_mode can be left blank. Will return true if the message sends successfully.| [ReplyKeyboard](https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot/blob/master/examples/ESP8266/CustomKeyboard/ReplyKeyboardMarkup/ReplyKeyboardMarkup.ino)|
56+
|*Inline Keyboards*|Your bot can send [inline keyboards](https://camo.githubusercontent.com/55dde972426e5bc77120ea17a9c06bff37856eb6/68747470733a2f2f636f72652e74656c656772616d2e6f72672f66696c652f3831313134303939392f312f324a536f55566c574b61302f346661643265323734336463386564613034). <br><br>Note: Only URLS are supported currently|`bool sendMessageWithInlineKeyboard(String chat_id, String text, String parse_mode, String keyboard)` <br><br> Send a keyboard to the specified chat_id. parse_mode can be left blank. Will return true if the message sends successfully.| [InlineKeyboard](https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot/blob/master/examples/ESP8266/CustomKeyboard/InlineKeyboardMarkup/InlineKeyboardMarkup.ino)|
57+
|*Send Photos*|It is possible to send phtos from your bot. You can send images from the web or from the arduino directly (Only sending from an SD card has been tested, but it should be able to send from a camera module)|Check the examples for more info| [From URL](https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot/blob/master/examples/ESP8266/SendPhoto/PhotoFromURL/PhotoFromURL.ino)<br><br>[Binary from SD](https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot/blob/master/examples/ESP8266/SendPhoto/PhotoFromSD/PhotoFromSD.ino)<br><br>[From File Id](https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot/blob/master/examples/ESP8266/SendPhoto/PhotoFromFileID/PhotoFromFileID.ino)|
58+
|*Chat Actions*|Your bot can send chat actions, such as *typing* or *sending photo* to let the user know that the bot is doing something. |`bool sendChatAction(String chat_id, String chat_action)` <br><br> Send a the chat action to the specified chat_id. There is a set list of chat actions that Telegram support, see the example for details. Will return true if the chat actions sends successfully.| [InlineKeyboard](https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot/tree/master/examples/ESP8266/ChatAction)|
5559

56-
bool sendMessage(String chat_id, String text, String parse_mode);
60+
The full Telegram Bot API documentation can be read [here](https://core.telegram.org/bots/api). If there is a feature you would like added to the library please either raise a Github issue or please feel free to raise a Pull Request.
5761

58-
Send a message to the specified chat_id. parse_mode can be left blank. Will return true if the message sends successfully.
5962

60-
#### sendMessageWithReplyKeyboard
63+
## Other Examples
6164

62-
bool sendMessageWithReplyKeyboard(String chat_id, String text,
63-
String parse_mode, String keyboard, bool resize = false,
64-
bool oneTime = false, bool selective = false);
65-
66-
Send a keyboard to the specified chat_id. parse_mode can be left blank. Will return true if the message sends successfully. See the CustomKeyboard example for more details.
67-
68-
#### getUpdates
69-
70-
int getUpdates(long offset);
71-
72-
Gets any pending messages from Telegram and stores them in bot.messages . Offset should be set to bot.last_message_recived + 1. Returns the numbers new messages received. See any of the examples for recommended usage.
73-
74-
75-
## Examples
76-
77-
Here are listed some examples to help you to build your own Bot:
65+
Some other examples are included you may find useful:
7866

7967
- BulkMessages : sends messages to multiple subscribers (ESP8266 only).
8068

81-
- EchoBot : replies echoing your messages.
82-
83-
- FlashLedBot : Reacts to your command switching ON/OFF a GPIO.
84-
85-
- CustomKeyboard : Same as FlashLedBot but also uses a replyKeyboard
86-
8769
- UsingWifiManager : Same as FlashLedBot but also uses WiFiManager library to configure WiFi (ESP8266 only).
8870

8971

0 commit comments

Comments
 (0)