Update functions.php

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

@ -141,6 +141,7 @@ function get_userinfo() {
function check_412($output,$get_area) { function check_412($output,$get_area) {
if (TG_NOTIFY == 1) { if (TG_NOTIFY == 1) {
$status = json_decode($output, true); $status = json_decode($output, true);
$msg = "";
if (SAVE_CACHE == 0) { if (SAVE_CACHE == 0) {
if ($status['code'] == -412) { if ($status['code'] == -412) {
$msg = '破服务器412啦地区:'.$get_area; $msg = '破服务器412啦地区:'.$get_area;
@ -159,10 +160,12 @@ function check_412($output,$get_area) {
} }
} }
} }
try { if ($msg != "") {
file_get_contents(TG_BOT_API.'/bot'.TG_BOT_KEY.'/sendMessage?chat_id='.TG_CHAT_ID.'&text='.$msg); try {
} catch (Exception $e) { file_get_contents(TG_BOT_API.'/bot'.TG_BOT_KEY.'/sendMessage?chat_id='.TG_CHAT_ID.'&text='.$msg);
// 不做任何事 } catch (Exception $e) {
// 不做任何事
}
} }
} }
} }

Loading…
Cancel
Save