diff --git a/bot.php b/bot.php index 12e63bb..9adeecc 100644 --- a/bot.php +++ b/bot.php @@ -79,7 +79,11 @@ $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;