Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

企业微信消息推送,如果消息接受者ID为空,则不会调用企业微信官方API. #1004

Merged
merged 3 commits into from
Jan 9, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions common/utils/sendmsg.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ def send_ding2user(self, userid_list, content):

def send_wx2user(self, msg, user_list):
to_user = '|'.join(list(set(user_list)))
if not to_user:
logger.error(f'企业微信推送失败,无法获取到推送的用户')
lesteryou marked this conversation as resolved.
Show resolved Hide resolved
return
access_token = get_wx_access_token()
send_url = f'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={access_token}'
data = {
Expand Down