added some error checking to prevent crashes
1 parent 4d11fd7 commit 9193b4aec59ee6660fd040f5cb53d3dc4027d296
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") {
if ($command == ":!req" && $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){ // response is for this bot
if ($ex[4] == $rand && $ex[5] <> ""){ // response is for this bot
get_code($ex[5]);
}
}
}
Buy Me A Coffee