修复 TG 412 提示bug

pull/37/head
david082321 2 years ago committed by GitHub
parent cbc1d83688
commit 0dad27853c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -138,27 +138,32 @@ function get_userinfo() {
}
// 412 提醒
function check_412($output,$get_area){
function check_412($output,$get_area) {
if (TG_NOTIFY == 1) {
$status = json_decode($output, true);
if(SAVE_CACHE == 0){
if (SAVE_CACHE == 0) {
if ($status['code'] == -412) {
file_get_contents(TG_BOT_API.'/'.TG_BOT_KEY.'/sendMessage?chat_id='.TG_CHAT_ID.'&text=破服务器412啦地区:' . $get_area);
$msg = '破服务器412啦地区:'.$get_area;
}
} else {
$latest_code = read_status($get_area);
if($latest_code != $status['code']){
if($status['code'] == -412){
file_get_contents(TG_BOT_API.'/'.TG_BOT_KEY.'/sendMessage?chat_id='.TG_CHAT_ID.'&text=破服务器412啦地区:' . $get_area);
if ($latest_code != $status['code']) {
if ($status['code'] == -412) {
$msg = '破服务器412啦地区:' . $get_area;
write_status($status['code'],$get_area);
} else {
if($latest_code == -412){
file_get_contents(TG_BOT_API.'/'.TG_BOT_KEY.'/sendMessage?chat_id='.TG_CHAT_ID.'&text=破服务器恢复啦,地区:' . $get_area);
if ($latest_code == -412) {
$msg = '破服务器恢复啦,地区:' . $get_area;
}
write_status(0,$get_area);
}
}
}
try {
file_get_contents(TG_BOT_API.'/'.TG_BOT_KEY.'/sendMessage?chat_id='.TG_CHAT_ID.'&text='.$msg);
} catch (Exception $e) {
// 不做任何事
}
}
}

Loading…
Cancel
Save