fix for people sending signal
1 parent 46e22df commit 0c753e08ec46f3095b1162aa2f5d41bbc5f3b328
root authored on 6 Aug 2021
Showing 1 changed file
View
4
bot.php
$devResponse = $serial->readPort();
$serial->deviceClose();
 
$toReturn = trim(preg_replace('/\s+/', ' ', $devResponse));
if(strpos($toReturn, "Thank you") === true){ // have sent more than 20 signals
$toReturn = trim(string_between_two_string($toReturn, 'Shared the Signal: ', 'Thank you'));
if(strpos($toReturn, "Thank you for doing your part") !== false){ // have sent more than 20 signals
$toReturn = trim(string_between_two_string($toReturn, 'Shared the Signal: ', 'Thank you for doing your part'));
}else{
$toReturn = trim(string_between_two_string($toReturn, 'Shared the Signal: ', 'se try again'));
}
//echo $toReturn; // DEBUG
Buy Me A Coffee