Skip to content

Commit

Permalink
♻️ 重构(message.py):改进变量命名,从bastUrl改为bast_url,以符合Python的PEP8命名规范
Browse files Browse the repository at this point in the history
  • Loading branch information
Sitoi committed Mar 8, 2024
1 parent fac507e commit 7fcc340
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions dailycheckin/utils/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,20 @@ def message2qywxrobot(qywx_key, content):


def message2qywxapp(
qywx_corpid, qywx_agentid, qywx_corpsecret, qywx_touser, qywx_media_id, qywx_origin, content
qywx_corpid,
qywx_agentid,
qywx_corpsecret,
qywx_touser,
qywx_media_id,
qywx_origin,
content,
):
print("企业微信应用消息推送开始")
bastUrl = "https://qyapi.weixin.qq.com"
bast_url = "https://qyapi.weixin.qq.com"
if qywx_origin:
bastUrl = qywx_origin;
bast_url = qywx_origin
res = requests.get(
f"{bastUrl}/cgi-bin/gettoken?corpid={qywx_corpid}&corpsecret={qywx_corpsecret}"
f"{bast_url}/cgi-bin/gettoken?corpid={qywx_corpid}&corpsecret={qywx_corpsecret}"
)
token = res.json().get("access_token", False)
if qywx_media_id:
Expand Down Expand Up @@ -164,7 +170,7 @@ def message2qywxapp(
},
}
requests.post(
url=f"{bastUrl}/cgi-bin/message/send?access_token={token}",
url=f"{bast_url}/cgi-bin/message/send?access_token={token}",
data=json.dumps(data),
)
return
Expand Down

0 comments on commit 7fcc340

Please sign in to comment.