more error checking
1 parent 9193b4a commit 6aaf902068c5982129e09739d02aaea73bd105a6
root authored on 5 Aug 2021
Showing 1 changed file
View
4
bot.php
$command = str_replace(array(
chr(10),
chr(13)
), '', $ex[3]);
if ($command == ":!req" && $ex[4] <> "" && $ex[5] <> "") {
if ($command == ":!req" && isset($ex[4]) && isset($ex[5]) && $ex[4] <> "" && $ex[5] <> "") {
// 4 = bot name, 5 = their code
if(!in_array($ex[4], $collected)){ // not already added their code
$response = get_code($ex[5]);
if(preg_match("/^[0-9A-Fa-f]{32}/", $response)){ // valid code back
}
}
}
if ($command == ":!rsp") {
if ($ex[4] == $rand && $ex[5] <> ""){ // response is for this bot
if ($ex[4] == $rand && isset($ex[5]) && $ex[5] <> ""){ // response is for this bot
get_code($ex[5]);
}
}
}
Buy Me A Coffee