Giter VIP home page Giter VIP logo

asynctelegram's Introduction

AsyncTelegram

Check the version https://github.com/cotestatnt/AsyncTelegram2


Introduction

AsyncTelegram is an Arduino class for managing Telegram Bot on ESP8266 and ESP32 platform.

When you add the possibility to send a message from your IoT application to a Telegram Bot, this should be only an additional "features" and not the core of your firmware. Unfortunately, most of Telegram libraries, stucks your micro while communicating with the Telegram Server in order to read properly the response and parse it.

AsyncTelegram do this job in async way and not interfee with the rest of code especially on ESP32 where we can take advantage of dual core architecture and move the task on the free core (core 0). With the ESP8266 this is not possible, so sending/receive tasks are splitted in two different moments, avoiding close the server connection in the meantime (https handshaking could be very slow).

It relies on ArduinoJson v6 library so, in order to use a AsyncTelegram object, you need to install the ArduinoJson library first (you can use library manager).

You also need to install the ESP8266 Arduino Core and Library or the ESP32 Arduino Core and Library.

Don't you know Telegram bots and how to setup one? Check this.

  • this library work with ArduinoJson library V6.x _

Features

  • Send and receive non-blocking messages to Telegram bot
  • Send photo both from url and from local filesystem (SPIFFS, LittleFS, FFAT, SD etc etc )
  • Inline keyboards
  • Reply keyboards
  • Receive localization messages
  • Receive contacts messages
  • Http communication on ESP32 work on own task pinned to Core0

To do

  • Send documents

Supported boards

The library works with the ESP8266 and ESP32 chipset.

Setting Clock time.

To ensure certificate validation, WiFiClientSecure needs time updated. To choose correct time zone, Follow this link https://sites.google.com/a/usapiens.com/opnode/time-zones and replace String value inside

 myBot.setClock("CET-1CEST,M3.5.0,M10.5.0/3");

with corresponding city time zone string.

Simple and responsive usage

Take a look at the examples provided in the examples folder.

Reference

Here how to use the library.

  • 1.1.3 Fix for callback query issue
  • 1.1.2 Lot of bug fixes, better memory management and more stability (especcially on ESP32)
  • 1.1.1 Backward compatibility
  • 1.1.0 Silent message (no notification) supported
  • 1.0.9 Added support for force_reply option (act as if the user has selected the bot's message and tapped 'Reply')
  • 1.0.8 Now you can update ESP firmware with a Telegram message (thanks to Vladimir!). Added example and instructions
  • 1.0.7 Added example for take picture with ESP32-CAM board
  • 1.0.6 AsyncTelegram now can send also pictures
  • 1.0.5 Added possibility to forward a messege to a puclic channel (bot must be one of admins) or to a specific user
  • 1.0.4 Fixed ArduinoJson ARDUINOJSON_DECODE_UNICODE define
  • 1.0.3 Bug fixes
  • 1.0.2 Added method for update Telegram server fingerprint (with online service https://www.grc.com/fingerprints.htm )
  • 1.0.1 Now is possible assign a callback function for every "inline keyboard button"
  • 1.0.0 Initial version

asynctelegram's People

Contributors

cotestatnt avatar gnalbandian avatar per1234 avatar saikek avatar shafr avatar shurillu avatar vlw avatar zzuutt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

asynctelegram's Issues

Callback query issue

Callback queries do not work. The reason is that m_inlineKeyboard is not set

Issue can be resolved by changing (in AsyncTelegram.h)

inline void sendMessage(const TBMessage &msg, const char* message, InlineKeyboard &keyboard)
{
    return sendMessage(msg, message, keyboard.getJSON());
}

to

inline void sendMessage(const TBMessage &msg, const char* message, InlineKeyboard &keyboard)
{
    m_inlineKeyboard = keyboard;
    return sendMessage(msg, message, keyboard.getJSON());
}

Authorization

How to authorize by chat id?
How to make the bot answer only one chat id?

doubts about how to use connection with fingerprint

Hi,
congratulations for your library, I find it much lighter than the others, and it was easy to use it and communicate with my bot. I have some questions for you about using the finger print:

  1. if I declare this in setup ():

// Set the Telegram bot properies
// api.telegram.org
uint8_t telegramFingerprint [20] = { 0xBB, 0xDC, 0x45, 0x2A, 0x07, 0xE3, 0x4A, 0x71, 0x33, 0x40, 0x32, 0xDA, 0xBE, 0x81, 0xF7, 0x72, 0x6F, 0x4A, 0x2B, 0x6B }; // https://www.grc.com/fingerprints.htm
myBot.setFingerprint(telegramFingerprint);
myBot.updateFingerPrint();
myBot.setUpdateTime(2000);
myBot.setTelegramToken(token);
myBot.begin();

is my connection with the telegram server already encrypted or do I have to do something else?

  1. how myBot.updateFingerPrint () works from the documentation I can't understand. Do you have any examples?

Thank you

sendToChannel

Thanks for library! One problem. sendToChannel works only one time.
`void loop()
.....
if ((millis() - temp_start) > 30000)
{
temp_start = millis();
tm* _tm;
time_t utcTime = time(NULL);
_tm = localtime(&utcTime);

    String str;
    char buf[100];
    strftime(buf, sizeof(buf), "This is esp32 message at:  %A, %B %d %Y %H:%M:%S", _tm);
    str = buf;
    Serial.println(str); //see it every 30 sec
    myBot.sendToChannel(channel_id, str, true);//see it only first time in my channel and in serial log
}

....
`

espressif8266 @ 3.0.0 warnings

Hi, when switching to new espressif8266 @ 3.0.0 framework AsyncTelegram is showing warnings:

Compiling .pio/build/nodemcuv2/lib719/ESP Async WebServer/SPIFFSEditor.cpp.o
.pio/libdeps/nodemcuv2/AsyncTelegram/src/AsyncTelegram.cpp: In member function 'bool AsyncTelegram::begin()':
.pio/libdeps/nodemcuv2/AsyncTelegram/src/AsyncTelegram.cpp:56:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   56 |   if (now < 8 * 3600 * 2)
      |   ^~
.pio/libdeps/nodemcuv2/AsyncTelegram/src/AsyncTelegram.cpp:59:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   59 |     telegramClient = new WiFiClientSecure;
      |     ^~~~~~~~~~~~~~
Archiving .pio/build/nodemcuv2/lib5f5/libESP8266HTTPClient.a
.pio/libdeps/nodemcuv2/AsyncTelegram/src/AsyncTelegram.cpp: In member function 'void AsyncTelegram::sendPhotoByUrl(const uint32_t&, const String&, const String&)':
.pio/libdeps/nodemcuv2/AsyncTelegram/src/AsyncTelegram.cpp:475:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  475 |     if (url.length() == 0)
      |     ^~
.pio/libdeps/nodemcuv2/AsyncTelegram/src/AsyncTelegram.cpp:477:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  477 |  smallDoc.clear();
      |  ^~~~~~~~
.pio/libdeps/nodemcuv2/AsyncTelegram/src/AsyncTelegram.cpp: In member function 'void AsyncTelegram::endQuery(const TBMessage&, const char*, bool)':
.pio/libdeps/nodemcuv2/AsyncTelegram/src/AsyncTelegram.cpp:507:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  507 |     if (strlen(msg.callbackQueryID) == 0)
      |     ^~
.pio/libdeps/nodemcuv2/AsyncTelegram/src/AsyncTelegram.cpp:509:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  509 |  smallDoc.clear();
      |  ^~~~~~~~

Can you please address them in next version?

It is not good to use the wifi check in the library

It is not good to use the wifi check in the library, it creates an external dependency.
I have also verified that sometimes the Wi-Fi is active, but the connection with telegram has been lost, due to errors, low speed, heating of the chip, etc.
I think it is better to use the checkConnection () function.

loss of sending multiple messages

I am using your scratch and it works very well, I only found 2 small problems:

  1. sometimes it loses the connection and is no longer reachable by telegram. Neither with incoming and outgoing messages.
  2. if I send more messages they are lost. I have seen that if I already send 2 messages the second does not arrive. For this problem I have built a FIFO queue at home, and I use it as a layer in the "sendMessage" method to insert the messages and in the "httpPostTask" to do the get of the messages and subsequent sending.

Do you think the change I inserted in point 2 can cause a loss of connection described in point 1?

Thank you for your ESP-32 Cam example, now I can receive a photo in full resolution

My objective was to have the ESP-32 camera send me a photo to Telegram every 10min, from 6h00 to 20h. To save energy and have more control over time and alarms, I added a DS3231 to my project. With other libraries and uploading methods, it was either not possible to send full resolution photos or it would fail after a while. It is crucial to have a good wifi connection and for that I upgraded the antenna (I have 4 units and pcb antenna gave me poor range in all of them), but it's also important to have a good power supply (good filtering to prevent artifacts in photos and high current delivery capability to maintain wifi communication).

https://github.com/FBMinis/DS3231-Alarm-ESP32-Cam-Telegram-Bot

Thank you for your work.

Add custom sendMessage parameter (feat request)

Add the possibility to append some parameter to the telegram sendMessage method.

A method with a signature like this could be helpful:

void sendMessage(const TBMessage &msg, const char* message, String booleanParameter = "", bool parameterValue);

The method could be even more generic using a linked list of a custom type and in the custom type we can specify the parameter name and value.

As an example I need to send a message without notification sound so I need to set the disable_notification parameter to true.

SIM800 support

Hi! Is it possible to use this library without connection to WIFI? I have SIM800 onboard (T-CALL) and there is no WIFI newtorks nearby. I use TinyGSM.

New release make code fail.

Dear Tolentino,
first of all Congratulation for this amazing delevopment.

I would like your help, if is possible.
Since you release new version I can't get make code working.
Initially let's inform you my setup:
ESP8266 nodeMCU and Wemos D1
ESP8266 Core = 2.7.4
ArduinoJson version: 6.17.1
AsyncTelegram version 1.0.8 (with a small change as described below)

In order to have the version 1.0.8 working I have to increase the Buffer Size as indicated in the issue: #6
So, in my library I have:
DynamicJsonDocument doc(BUFFER_BIG);


I have attached the code and also the library I am using, in order to keep same scenario.

test_AsyncTelegram.zip


As soon as I update your library for last version, inline keyboard is not available anymore, even change the code as before.

To test:
You should inform your userId, because I have in this code is a function to validate the user who will interact with the bot.

int userId[] = {2360873, 0, 0, 0, 0, 0}; //--> Should include your UserID ==> send message to @myidbot

Thanks in Advance.

Edson

inline keyboard not working

Both the keyboard example not working. Only replykeboard is working. when pressing any button on inline keboard nothing happens.

Messages gets lost

Hello,
I'm having a little problem using the library you've made. I have a sketch that is doing a lot of serial reading, three devices at 2400 baud and one at 9600. Of course I have to wait for answer for every command i send to the devices. For that i'm using vTaskDelay (not delay).
In certain cases, the sketch has to send messages. Some of those messages gets lost. They don't arrive at all.
The setUpdateTime was set at 2000 and I've changed it to 1000...same problem. I've tried to add a vTaskDelay after sendToUser...same problem. I'm using String variable to compose my message.

Do you have any advice for me? Thank you!

Strange behavior when ESP32-CAM initiate an image send

I am trying to expand ESP32-CAM.ino for my needs. An image request by /takeFoto command from my Bot works great. But when I trying to initiate capturing and sending an image by ESP itself by executing code string
myBot.sendPhotoByFile(chat_id, myFile, filesystem);
on pushing a button, then 50:50 an image will be sent and receied by my Bot OR one of two next exceptions will be occured and then ESP reboots:
`
--- Exception 1
Decoding stack results
0x40090de4: invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 156
0x4009105d: abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 171
0x40088c6d: lock_acquire_generic at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/locks.c line 143
0x40088d99: _lock_acquire_recursive at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/locks.c line 171
0x400f013f: _vfiprintf_r at ../../../.././newlib/libc/stdio/vfprintf.c line 860
0x400e9541: fiprintf at ../../../.././newlib/libc/stdio/fiprintf.c line 50
0x400e9458: __assert_func at ../../../.././newlib/libc/stdlib/assert.c line 59
0x400963c1: multi_heap_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/multi_heap_poisoning.c line 218
0x400893ae: heap_caps_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c line 268
0x40088ad5: esp_mbedtls_mem_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/port/esp_mem.c line 35
0x4015ef52: mbedtls_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/platform.c line 98
0x40153d8e: mbedtls_ssl_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/ssl_tls.c line 8992
0x400db39a: stop_ssl_socket(sslclient_context*, char const*, char const*, char const*) at /Users/alexey/Library/Arduino15/packages/esp32/hardware/esp32/1.0.5/libraries/WiFiClientSecure/src/ssl_client.cpp line 272
0x400daf40: WiFiClientSecure::stop() at /Users/alexey/Library/Arduino15/packages/esp32/hardware/esp32/1.0.5/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp line 87
0x400db059: WiFiClientSecure::write(unsigned char const*, unsigned int) at /Users/alexey/Library/Arduino15/packages/esp32/hardware/esp32/1.0.5/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp line 185
0x400d9ffb: HTTPClient::sendHeader(char const*) at /Users/alexey/Library/Arduino15/packages/esp32/hardware/esp32/1.0.5/libraries/HTTPClient/src/HTTPClient.cpp line 1178
0x400daae9: HTTPClient::sendRequest(char const*, unsigned char*, unsigned int) at /Users/alexey/Library/Arduino15/packages/esp32/hardware/esp32/1.0.5/libraries/HTTPClient/src/HTTPClient.cpp line 585
0x400dac03: HTTPClient::POST(unsigned char*, unsigned int) at /Users/alexey/Library/Arduino15/packages/esp32/hardware/esp32/1.0.5/libraries/HTTPClient/src/HTTPClient.cpp line 504
0x400dac27: HTTPClient::POST(String) at /Users/alexey/Library/Arduino15/packages/esp32/hardware/esp32/1.0.5/libraries/HTTPClient/src/HTTPClient.cpp line 509
0x400d5bae: AsyncTelegram::httpPostTask(void*) at /Users/alexey/Documents/Arduino/libraries/AsyncTelegram/src/AsyncTelegram.cpp line 195
0x40092cde: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143

--- Exception 2
0x40090de4: invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 156
0x4009105d: abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 171
0x40088c6d: lock_acquire_generic at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/locks.c line 143
0x40088d99: _lock_acquire_recursive at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/locks.c line 171
0x400f013f: _vfiprintf_r at ../../../.././newlib/libc/stdio/vfprintf.c line 860
0x400e9541: fiprintf at ../../../.././newlib/libc/stdio/fiprintf.c line 50
0x400e9458: __assert_func at ../../../.././newlib/libc/stdlib/assert.c line 59
0x400963c1: multi_heap_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/multi_heap_poisoning.c line 218
0x400893ae: heap_caps_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c line 268
0x40088ad5: esp_mbedtls_mem_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/port/esp_mem.c line 35
0x4015ef52: mbedtls_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/platform.c line 98
0x40153d8e: mbedtls_ssl_free at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/ssl_tls.c line 8992
0x400db39a: stop_ssl_socket(sslclient_context*, char const*, char const*, char const*) at /Users/alexey/Library/Arduino15/packages/esp32/hardware/esp32/1.0.5/libraries/WiFiClientSecure/src/ssl_client.cpp line 272
0x400daf40: WiFiClientSecure::stop() at /Users/alexey/Library/Arduino15/packages/esp32/hardware/esp32/1.0.5/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp line 87
0x400db059: WiFiClientSecure::write(unsigned char const*, unsigned int) at /Users/alexey/Library/Arduino15/packages/esp32/hardware/esp32/1.0.5/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp line 185
0x400dc7f5: Print::print(String const&) at /Users/alexey/Library/Arduino15/packages/esp32/hardware/esp32/1.0.5/cores/esp32/Print.h line 72
0x400d93d2: AsyncTelegram::sendMultipartFormData(String const&, unsigned int const&, String const&, char const*, char const*, fs::FS&) at /Users/alexey/Documents/Arduino/libraries/AsyncTelegram/src/AsyncTelegram.cpp line 768
0x400d959b: AsyncTelegram::sendPhotoByFile(unsigned int const&, String const&, fs::FS&) at /Users/alexey/Documents/Arduino/libraries/AsyncTelegram/src/AsyncTelegram.cpp line 722
0x400d1d16: sendPicture(unsigned int) at /Users/alexey/Documents/Arduino/smart-wifi-door_bell/door_bell/door_bell.ino line 200
0x400d1e29: loop() at /Users/alexey/Documents/Arduino/smart-wifi-door_bell/door_bell/door_bell.ino line 233
0x400ddd21: loopTask(void*) at /Users/alexey/Library/Arduino15/packages/esp32/hardware/esp32/1.0.5/cores/esp32/main.cpp line 37
0x40092cde: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143`

Memory leak when Telegram server close the connection

Hi,

This issue report started as a comment here :)

I just flashed the dev branch to my ESP32,
I will leave it to run in debug mode and capture its log to a file - I will report if the problem occurs.

From a 5 minutes test, the memory seems stable with:
Heap: 176092, MaxFree: 113792, Task stack: 6576

Thanks for all the great work on the dev branch!
Arad.

ESP32 gif message crash

I modified the inlinekeyboard example and my bot is now working with messages of type
MessageText
MessageQuery
MessageContact

As I was testing my bot I accidentally send a GIF from the client to the bot and the ESP crashed and got stuck in a bootloop. After getting the (GIF-)messages with a Pi Bot script the ESP was working again. I then testet image video and sticker messages and they are ignored by my code as expected. Only GIFs run the ESP into a bootloop.

Here is my serial output:

`Start connection to WiFi.......
WiFi connected! IP address: 192.168.0.52
Waiting for NTP time sync:
Test Telegram connection...
Start http request task on core 0
OK

Stack smashing protect failure!

abort() was called at PC 0x40158307 on core 1

ELF file SHA256: 0000000000000000

Backtrace: 0x4008858c:0x3ffb1ac0 0x40088809:0x3ffb1ae0 0x40158307:0x3ffb1b00 0x400d3575:0x3ffb1b20 0x400d4a85:0x3ffb1b90 0x400d1041:0x3ffb1d80

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5856
entry 0x400806a8
Read:720
setup() running on core 1
Free heap: 277988

Start connection to WiFi.......`

Flush message queue?

Among the commands I am sending to my telegram-controlled bot device, there is the /reboot to ask the device to restart. The problem is that as soon as the device returns ready, it will get another /reboot command and so on forever.

Is there a way to "flush" the message queue before rebooting the device (or upon starting)?

Не работает OTAupdate_ESP8266

при отправки боту обновленного бин файла с подписью fw он шлет в обратку: Error: file caption is not 'fw
и Send firmware binary file ###.bin with caption 'fw'

а в ком порту:
[D][AsyncTelegram.cpp:417] getFile():
{
"ok": true,
"result": {
"file_id": "BQACAgIAAxkBAAM4YW9gbbykcMlidfn0wJuGU7NNZP4AAngRAAIeM3hLXJgffd34P4UhBA",
"file_unique_id": "AgADeBEAAh4zeEs",
"file_size": 438383,
"file_path": "documents/file_6.bin"
}
}
[D][AsyncTelegram.cpp:463] sendMessage():
{
"chat_id": 596684527,
"text": "Error: file caption is not 'fw'"
}

Error on AsyncTelegram.h for esp8266

Good Morning! I've a big trouble 'cause i can't compiling any sketch in Arduino.
Any time i'm compiling a sketch with this library i've got the error:

C:\Users\Utente\Documents\Arduino\libraries\AsyncTelegram\src/AsyncTelegram.h:191:5: error: 'BearSSL' does not name a type
BearSSL::WiFiClientSecure telegramClient;
^
exit status 1

i've this library installed:
ArduinoJson 6.17.2
AsyncTelegram 1.0.8

I don't know how to resolve. Thanks in advance for the help and sorry for my mistake

Transmitting characters

hello! A good library! The only question is, if you load the sketch from the echo example, the transmission of the characters -,*,. does not work, and if you write any other character, for example, 567, everything works. I use esp8266 nodemcu, board version 2.7.4, json 6.18.0. Sorry for my English))

Reply Keyboard can have not more than 10 buttons

When I'm trying to add 11-th button to the Reply Keyboard, it stops sending messages.

In master/src/AsyncTelegram.cpp: void AsyncTelegram::sendMessage
It turned out that 512 is not enough:

if (keyboard.length() != 0) {
    DynamicJsonDocument doc(512);
    deserializeJson(doc, keyboard);
    JsonObject myKeyb = doc.as<JsonObject>();
    root["reply_markup"] = myKeyb;
}

If I change DynamicJsonDocument doc(512); to DynamicJsonDocument doc(1024); it works fine.
Maybe it should be changed to BUFFER_BIG, or 1024 is enough.
Have a good day.

How to get the user chat_id

i'm trying to make some kind of user authentication and the only possible way to track a user is by chat id, but i couldn't see any public method or attribute in the header file referring to the chat id for an incoming message, is it not possible or i didn't notice it ?

sendToUser

I cannot use this construct:

myBot.sendToUser(userid, "test");

How to use it correctly?
If I replace "test" with a variable of type string - Everything works.

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.