You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an example of how one can update inline keyboard messages (buttons).
4
+
The message_id of the specific message is sent when a message is received.
5
+
This message_id can be used to UPDATE that message.
6
+
One can update text inside a message, but also buttons can be updated.
7
+
This way one can build menu's, like the menu the botfather uses.
8
+
9
+
In this simple example we use a inlinekeyboard button to toggle (and update) the state of a LED.
10
+
11
+
NOTE: You will need to enter your SSID, password and bot Token for the example to work.
12
+
13
+
Example and update to Universal-Arduino-Telegram-Bot originally written by
14
+
[Frits Jan van Kempen] (https://github.com/fritsjan) with inspiration from [RomeHein] (https://github.com/RomeHein)
15
+
16
+
Adapted by [Brian Lough](https://github.com/witnessmenow)
17
+
18
+
## License
19
+
20
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
21
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
keyboardJson += ", [{ \"text\" : \"Send text\", \"callback_data\" : \"This text was sent by inline button\" }]"; // add another button
83
+
//keyboardJson += ", [{ \"text\" : \"Go to Google\", \"url\" : \"https://www.google.com\" }]"; // add another button, this one appears after first Update
84
+
keyboardJson += "]"; // end Json
85
+
86
+
// Now send this message including the current message_id as the 5th input to UPDATE that message
while (millis() < sttime + 8000) { // loop for a while to send the message
644
+
String response = sendPostToTelegram((edit ? BOT_CMD("editMessageText") : BOT_CMD("sendMessage")), payload);// if edit is true we send a editMessageText CMD
0 commit comments