From d81ee50feac96938d11cd740439514c7b743a482 Mon Sep 17 00:00:00 2001 From: zhonghuaifang <56331610+zhonghuaifang@users.noreply.github.com> Date: Tue, 7 Feb 2023 10:23:47 +0800 Subject: [PATCH] Update sendNotify.py --- function/xiaomi_sports/sendNotify.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/function/xiaomi_sports/sendNotify.py b/function/xiaomi_sports/sendNotify.py index 34b1e41..141c403 100644 --- a/function/xiaomi_sports/sendNotify.py +++ b/function/xiaomi_sports/sendNotify.py @@ -307,8 +307,11 @@ def go_cqhttp(self, title, content): print("go-cqhttp 服务的 GOBOT_URL 或 GOBOT_QQ 或 GOBOT_TOKEN 未设置!!\n取消推送") return print("go-cqhttp 服务启动") - - url = f'{sendNotify.GOBOT_URL}?access_token={sendNotify.GOBOT_TOKEN}&{sendNotify.GOBOT_QQ}&message=标题:{title}\n内容:{content}' + + if '/send_group_msg' in sendNotify.GOBOT_URL: + url = f'{sendNotify.GOBOT_URL}?access_token={sendNotify.GOBOT_TOKEN}&group_id={sendNotify.GOBOT_QQ}&message=标题:{title}\n内容:{content}' + else: + url = f'{sendNotify.GOBOT_URL}?access_token={sendNotify.GOBOT_TOKEN}&user_id={sendNotify.GOBOT_QQ}&message=标题:{title}\n内容:{content}' try: response = requests.get(url, timeout=15)