Skip to content

Commit 2362e2c

Browse files
committed
Fixing up examples, hopefully! #4
1 parent 5c1dad5 commit 2362e2c

File tree

8 files changed

+26
-26
lines changed

8 files changed

+26
-26
lines changed

examples/101/CustomKeyboard/CustomKeyboard.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@ void handleNewMessages(int numNewMessages) {
3434
for(int i=0; i<numNewMessages; i++) {
3535
String chat_id = String(bot.messages[i].chat_id);
3636
String text = bot.messages[i].text;
37-
if (text == "\/ledon") {
37+
if (text == "/ledon") {
3838
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
3939
ledStatus = 1;
4040
bot.sendMessage(chat_id, "Led is ON", "");
4141
}
42-
if (text == "\/ledoff") {
42+
if (text == "/ledoff") {
4343
ledStatus = 0;
4444
digitalWrite(ledPin, LOW); // turn the LED off (LOW is the voltage level)
4545
bot.sendMessage(chat_id, "Led is OFF", "");
4646
}
47-
if (text == "\/status") {
47+
if (text == "/status") {
4848
if(ledStatus){
4949
bot.sendMessage(chat_id, "Led is ON", "");
5050
} else {
5151
bot.sendMessage(chat_id, "Led is OFF", "");
5252
}
5353
}
54-
if (text == "\/options") {
54+
if (text == "/options") {
5555
StaticJsonBuffer<500> jsonBuffer;
5656
JsonObject& payload = jsonBuffer.createObject();
5757
payload["chat_id"] = chat_id;
@@ -71,7 +71,7 @@ void handleNewMessages(int numNewMessages) {
7171
bot.sendPostMessage(payload);
7272
}
7373

74-
if (text == "\/start") {
74+
if (text == "/start") {
7575
String wellcome = "The custom keyboard example for ESP8266TelegramBot";
7676
String wellcome1 = "/ledon : to switch the Led ON";
7777
String wellcome2 = "/ledoff : to switch the Led OFF";
@@ -103,7 +103,7 @@ void setup() {
103103
Serial.println("IP address: ");
104104
IPAddress ip = WiFi.localIP();
105105
Serial.println(ip);
106-
bot.begin(); // launch Bot functionalities
106+
107107
pinMode(ledPin, OUTPUT); // initialize digital ledPin as an output.
108108
delay(10);
109109
digitalWrite(ledPin, HIGH); //initilase pin as off

examples/101/EchoBot/EchoBot.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void setup() {
5656
IPAddress ip = WiFi.localIP();
5757
Serial.println(ip);
5858

59-
bot.begin(); // launch Bot functionalities
59+
6060
}
6161

6262

examples/101/EchoBotWithPost/EchoBotWithPost.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void setup() {
5858
IPAddress ip = WiFi.localIP();
5959
Serial.println(ip);
6060

61-
bot.begin(); // launch Bot functionalities
61+
6262
}
6363

6464

examples/101/FlashledBot/FlashledBot.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,24 @@ void handleNewMessages(int numNewMessages) {
3636
for(int i=0; i<numNewMessages; i++) {
3737
String chat_id = String(bot.messages[i].chat_id);
3838
String text = bot.messages[i].text;
39-
if (text == "\/ledon") {
39+
if (text == "/ledon") {
4040
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
4141
ledStatus = 1;
4242
bot.sendMessage(chat_id, "Led is ON", "");
4343
}
44-
if (text == "\/ledoff") {
44+
if (text == "/ledoff") {
4545
ledStatus = 0;
4646
digitalWrite(ledPin, LOW); // turn the LED off (LOW is the voltage level)
4747
bot.sendMessage(chat_id, "Led is OFF", "");
4848
}
49-
if (text == "\/status") {
49+
if (text == "/status") {
5050
if(ledStatus){
5151
bot.sendMessage(chat_id, "Led is ON", "");
5252
} else {
5353
bot.sendMessage(chat_id, "Led is OFF", "");
5454
}
5555
}
56-
if (text == "\/start") {
56+
if (text == "/start") {
5757
String wellcome = "Wellcome from FlashLedBot, your personal Bot on ESP8266 board";
5858
String wellcome1 = "/ledon : to switch the Led ON";
5959
String wellcome2 = "/ledoff : to switch the Led OFF";
@@ -84,7 +84,7 @@ void setup() {
8484
Serial.println("IP address: ");
8585
IPAddress ip = WiFi.localIP();
8686
Serial.println(ip);
87-
bot.begin(); // launch Bot functionalities
87+
8888
pinMode(ledPin, OUTPUT); // initialize digital ledPin as an output.
8989
delay(10);
9090
digitalWrite(ledPin, HIGH); //initilase pin as off

examples/ESP8266/CustomKeyboard/CustomKeyboard.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@ void handleNewMessages(int numNewMessages) {
3434
for(int i=0; i<numNewMessages; i++) {
3535
String chat_id = String(bot.messages[i].chat_id);
3636
String text = bot.messages[i].text;
37-
if (text == "\/ledon") {
37+
if (text == "/ledon") {
3838
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
3939
ledStatus = 1;
4040
bot.sendMessage(chat_id, "Led is ON", "");
4141
}
42-
if (text == "\/ledoff") {
42+
if (text == "/ledoff") {
4343
ledStatus = 0;
4444
digitalWrite(ledPin, LOW); // turn the LED off (LOW is the voltage level)
4545
bot.sendMessage(chat_id, "Led is OFF", "");
4646
}
47-
if (text == "\/status") {
47+
if (text == "/status") {
4848
if(ledStatus){
4949
bot.sendMessage(chat_id, "Led is ON", "");
5050
} else {
5151
bot.sendMessage(chat_id, "Led is OFF", "");
5252
}
5353
}
54-
if (text == "\/options") {
54+
if (text == "/options") {
5555
StaticJsonBuffer<500> jsonBuffer;
5656
JsonObject& payload = jsonBuffer.createObject();
5757
payload["chat_id"] = chat_id;
@@ -71,7 +71,7 @@ void handleNewMessages(int numNewMessages) {
7171
bot.sendPostMessage(payload);
7272
}
7373

74-
if (text == "\/start") {
74+
if (text == "/start") {
7575
String wellcome = "The custom keyboard example for ESP8266TelegramBot";
7676
String wellcome1 = "/ledon : to switch the Led ON";
7777
String wellcome2 = "/ledoff : to switch the Led OFF";
@@ -103,7 +103,7 @@ void setup() {
103103
Serial.println("IP address: ");
104104
IPAddress ip = WiFi.localIP();
105105
Serial.println(ip);
106-
bot.begin(); // launch Bot functionalities
106+
107107
pinMode(ledPin, OUTPUT); // initialize digital ledPin as an output.
108108
delay(10);
109109
digitalWrite(ledPin, HIGH); //initilase pin as off

examples/ESP8266/EchoBot/EchoBot.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void setup() {
5555
IPAddress ip = WiFi.localIP();
5656
Serial.println(ip);
5757

58-
bot.begin(); // launch Bot functionalities
58+
5959
}
6060

6161

examples/ESP8266/EchoBotWithPost/EchoBotWithPost.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void setup() {
5757
IPAddress ip = WiFi.localIP();
5858
Serial.println(ip);
5959

60-
bot.begin(); // launch Bot functionalities
60+
6161
}
6262

6363

examples/ESP8266/FlashledBot/FlashledBot.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,24 @@ void handleNewMessages(int numNewMessages) {
3636
for(int i=0; i<numNewMessages; i++) {
3737
String chat_id = String(bot.messages[i].chat_id);
3838
String text = bot.messages[i].text;
39-
if (text == "\/ledon") {
39+
if (text == "/ledon") {
4040
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
4141
ledStatus = 1;
4242
bot.sendMessage(chat_id, "Led is ON", "");
4343
}
44-
if (text == "\/ledoff") {
44+
if (text == "/ledoff") {
4545
ledStatus = 0;
4646
digitalWrite(ledPin, LOW); // turn the LED off (LOW is the voltage level)
4747
bot.sendMessage(chat_id, "Led is OFF", "");
4848
}
49-
if (text == "\/status") {
49+
if (text == "/status") {
5050
if(ledStatus){
5151
bot.sendMessage(chat_id, "Led is ON", "");
5252
} else {
5353
bot.sendMessage(chat_id, "Led is OFF", "");
5454
}
5555
}
56-
if (text == "\/start") {
56+
if (text == "/start") {
5757
String wellcome = "Wellcome from FlashLedBot, your personal Bot on ESP8266 board";
5858
String wellcome1 = "/ledon : to switch the Led ON";
5959
String wellcome2 = "/ledoff : to switch the Led OFF";
@@ -84,7 +84,7 @@ void setup() {
8484
Serial.println("IP address: ");
8585
IPAddress ip = WiFi.localIP();
8686
Serial.println(ip);
87-
bot.begin(); // launch Bot functionalities
87+
8888
pinMode(ledPin, OUTPUT); // initialize digital ledPin as an output.
8989
delay(10);
9090
digitalWrite(ledPin, HIGH); //initilase pin as off

0 commit comments

Comments
 (0)