Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Reply Keyboard can have not more than 10 buttons #6

Closed
andoryu-kun opened this issue Jan 17, 2021 · 2 comments
Closed

Reply Keyboard can have not more than 10 buttons #6

andoryu-kun opened this issue Jan 17, 2021 · 2 comments
Assignees

Comments

@andoryu-kun
Copy link

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.

@cotestatnt cotestatnt self-assigned this Jan 19, 2021
@HackEduca
Copy link

Worked for me as well, thanks!

@cotestatnt
Copy link
Owner

Increased the size in release 1.0.9

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants