hi everyone, my name is mohammad im 31 years old had some C language classes when i was at high school, now we have alot of power cuts in my country and im using a generator a friend adviced that i use esp8266 to detect if its government electricity or my solar/generator electricity, so far i have managed to define pins connect to wifi etc...... but when i write the code in void loop so that whenever a pin's status change it sends me a message, it keeps on sending me the same message as long as the pin is in it's current state- if(lets say pin1=1){
bot.sendMessage(CHAT_ID, "EDL IS ON", "");
Serial.println("EDL IS ON");
how can i set it to only send 1 message whenever that pin for example state changes. thanks in advance and have a good day