diff --git a/conf/user.ini.example b/conf/user.ini.example index 97a6698..300a049 100644 --- a/conf/user.ini.example +++ b/conf/user.ini.example @@ -180,8 +180,9 @@ filter_words = [notify.dingtalk] token = -; Tele机器人|token|chatid|依赖USE_NOTIFY +; Tele机器人|url(可选)|token|chatid|依赖USE_NOTIFY [notify.telegram] +url = bottoken = chatid = diff --git a/src/plugin/Notice.php b/src/plugin/Notice.php index ebc1dcc..458366b 100644 --- a/src/plugin/Notice.php +++ b/src/plugin/Notice.php @@ -189,7 +189,8 @@ class Notice private static function teleSend(array $info) { Log::info('使用Tele机器人推送消息'); - $url = 'https://api.telegram.org/bot' . getConf('bottoken', 'notify.telegram') . '/sendMessage'; + $base_url = getConf('url', 'notify.telegram') ?: 'https://api.telegram.org/bot'; + $url = $base_url . getConf('bottoken', 'notify.telegram') . '/sendMessage'; $payload = [ 'chat_id' => getConf('chatid', 'notify.telegram'), 'text' => $info['content']