From 4cf564b6eaa0239b18e4a38de376f525eeef6d08 Mon Sep 17 00:00:00 2001 From: david082321 <7046617+david082321@users.noreply.github.com> Date: Wed, 6 Jul 2022 17:14:27 +0800 Subject: [PATCH] Update functions.php --- utils/functions.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/utils/functions.php b/utils/functions.php index e78465a..78182af 100644 --- a/utils/functions.php +++ b/utils/functions.php @@ -141,6 +141,7 @@ function get_userinfo() { function check_412($output,$get_area) { if (TG_NOTIFY == 1) { $status = json_decode($output, true); + $msg = ""; if (SAVE_CACHE == 0) { if ($status['code'] == -412) { $msg = '破服务器412啦,地区:'.$get_area; @@ -159,10 +160,12 @@ function check_412($output,$get_area) { } } } - try { - file_get_contents(TG_BOT_API.'/bot'.TG_BOT_KEY.'/sendMessage?chat_id='.TG_CHAT_ID.'&text='.$msg); - } catch (Exception $e) { - // 不做任何事 + if ($msg != "") { + try { + file_get_contents(TG_BOT_API.'/bot'.TG_BOT_KEY.'/sendMessage?chat_id='.TG_CHAT_ID.'&text='.$msg); + } catch (Exception $e) { + // 不做任何事 + } } } }