13 lines
397 B
Python
13 lines
397 B
Python
import httpx
|
|
import config
|
|
|
|
|
|
async def send_image(base64_str: str, md5: str):
|
|
url = f"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={config.WECHAT_COMANY_BOT_KEY}"
|
|
|
|
payload = {"msgtype": "image", "image": {"base64": base64_str, "md5": md5}}
|
|
|
|
async with httpx.AsyncClient(timeout=10) as client:
|
|
resp = await client.post(url, json=payload)
|
|
resp.raise_for_status()
|