Skip to content

Commit 6d55106

Browse files
committed
Add examples with from_name
1 parent f51e8a8 commit 6d55106

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

examples/101/FlashledBot/FlashledBot.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ void handleNewMessages(int numNewMessages) {
5454
}
5555
}
5656
if (text == "/start") {
57-
String welcome = "Welcome from FlashLedBot, your personal Bot on Arduino 101\n";
57+
String from_name = message.from_name;
58+
if (from_name == "") from_name = "Anonymous";
59+
60+
String welcome = "Welcome, " + from_name + ", from FlashLedBot, your personal Bot on Arduino 101\n";
5861
welcome = welcome + "/ledon : to switch the Led ON \n";
5962
welcome = welcome + "/ledoff : to switch the Led OFF \n";
6063
welcome = welcome + "/status : Returns current status of LED \n";

examples/ESP8266/FlashledBot/FlashledBot.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ void handleNewMessages(int numNewMessages) {
5454
}
5555
}
5656
if (text == "/start") {
57-
String welcome = "Welcome from FlashLedBot, your personal Bot on ESP8266\n";
57+
String from_name = message.from_name;
58+
if (from_name == "") from_name = "Anonymous";
59+
60+
String welcome = "Welcome, " + from_name + ", from FlashLedBot, your personal Bot on ESP8266\n";
5861
welcome = welcome + "/ledon : to switch the Led ON\n";
5962
welcome = welcome + "/ledoff : to switch the Led OFF\n";
6063
welcome = welcome + "/status : Returns current status of LED\n";

0 commit comments

Comments
 (0)