From 7871198933b416f46244acf4d5f2c9570befb779 Mon Sep 17 00:00:00 2001 From: Lkeme <19500576+lkeme@users.noreply.github.com> Date: Sun, 3 Oct 2021 23:40:23 +0800 Subject: [PATCH] [update] TgBotNotice closed#123 --- conf/user.ini.example | 3 ++- src/plugin/Notice.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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']