feat: add check if wifi connected
This commit is contained in:
@ -11,8 +11,9 @@ DiscordAPI::DiscordAPI(String hookUrl){
|
||||
bool DiscordAPI::sendMessage(String message){
|
||||
bool sortie = true;
|
||||
|
||||
//TODO: faire test si le wifi est bien connecter
|
||||
|
||||
if(WiFi.status() != WL_CONNECTED){
|
||||
return false;
|
||||
}
|
||||
|
||||
this->httpClient->begin(*this->wifiClient, this->hookUrl);
|
||||
this->httpClient->addHeader("Content-Type", "application/json");
|
||||
@ -25,4 +26,4 @@ bool DiscordAPI::sendMessage(String message){
|
||||
}
|
||||
this->httpClient->end();
|
||||
return sortie;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user