开源软件名称(OpenSource Name):CasaJasmina/TelegramBot-Library开源软件地址(OpenSource Url):https://github.com/CasaJasmina/TelegramBot-Library开源编程语言(OpenSource Language):C++ 100.0%开源软件介绍(OpenSource Introduction):TelegramBot LibraryA project by Casa Jasmina IntroductionThis 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. InstallingThe library can be installed from the library manager or added manually selecting the menu:
You also have to install the ArduinoJson library written by Benoît Blanchon. Available here. Getting startedView 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 ReferenceTelegramBot(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 implementationWhen 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:
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. ReliabilityIn 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. LicenseYou 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. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论