Skip to content

Commit

Permalink
Update sendNotify.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zhonghuaifang authored Feb 7, 2023
1 parent 3222f6e commit d81ee50
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions function/xiaomi_sports/sendNotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d81ee50

Please sign in to comment.