fix for people sending signal
1 parent 86d7e8b commit 46e22df1dc80614a08c136544b5a8769139606d5
root authored on 6 Aug 2021
Showing 1 changed file
View
2
■■■
bot.php
$devResponse = $serial->readPort();
$serial->deviceClose();
 
$toReturn = trim(preg_replace('/\s+/', ' ', $devResponse));
if(str_contains($toReturn, "Thank you")){
if(strpos($toReturn, "Thank you") === true){ // have sent more than 20 signals
$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'));
}
Buy Me A Coffee