18 lines
454 B
Python
18 lines
454 B
Python
import requests
|
|
import json
|
|
|
|
webhook_url = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send'
|
|
webhook_key = 'f09eb098-f709-4fc6-83b5-4a08a8431b8f'
|
|
|
|
|
|
def send_wechat_message(message: str):
|
|
response = requests.post(
|
|
webhook_url,
|
|
headers={
|
|
"Content-Type": "application/json"
|
|
},
|
|
params={'key': webhook_key},
|
|
data=json.dumps(message, ensure_ascii=False).encode('utf-8')
|
|
)
|
|
|
|
return response.json() |