cotestatnt / AsyncTelegram2

Powerful, flexible and secure Arduino Telegram BOT library. Hardware independent, it can be used with any MCU capable of handling an SSL connection.
MIT License
83 stars 25 forks source link

addButton do not copy text and command #128

Open Tommy4chan opened 8 months ago

Tommy4chan commented 8 months ago

When I tried to use this function with InlineKeyboard to dynamically generate keyboard with CallbackType at setup. It will show me that text and command is alright when I try to view InlineKeyboard as JSON but actually it doesn`t work.

When I catch msg.callbackQueryData it shows that text of command is right but do not trigger CallbackType function

Code example which doesn't work

` void generateRepeatingButtons(InlineKeyboard& keyboard, String wordBeginning, byte startIndex, byte endIndex, CallbackType fn) { for (byte i = startIndex; i < endIndex; i++) { String temp = wordBeginning + String(i);

keyboard.addButton(temp.c_str(), temp.c_str(), KeyboardButtonQuery, fn);
if (i % 2 == 1)
{
  keyboard.addRow();
}

} } `