fix for people sending signal
1 parent 804483f commit 86d7e8bb7859c159ca40f061f9febb7e389609e6
root authored on 6 Aug 2021
Showing 1 changed file
View
10
bot.php
$devResponse = $serial->readPort();
$serial->deviceClose();
 
$toReturn = trim(preg_replace('/\s+/', ' ', $devResponse));
$toReturn = trim(string_between_two_string($toReturn, 'Shared the Signal: ', 'Thank you'));
if(str_contains($toReturn, "Thank you")){
$toReturn = trim(string_between_two_string($toReturn, 'Shared the Signal: ', 'Thank you'));
}else{
$toReturn = trim(string_between_two_string($toReturn, 'Shared the Signal: ', 'se try again'));
}
//echo $toReturn; // DEBUG
 
return $toReturn;
}
Buy Me A Coffee