Appearance
CDN 消息
CDN 消息接口使用 CDN 参数发送消息,适用于转发其他账号收到的媒体消息。
send_text_by_cdn
通过 CDN 接口发送文本消息。
python
wechat.send_text_by_cdn(client_id, to_wxid, content)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 接收者wxid |
| content | str | 文本内容 |
send_room_at_by_cdn
通过 CDN 接口发送群@消息。
python
wechat.send_room_at_by_cdn(client_id, to_wxid, content, at_list=None, at_all=0)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 群wxid |
| content | str | 消息内容 |
| at_list | list | @的成员wxid列表 |
| at_all | int | 是否@所有人 (0/1) |
send_card_by_cdn
通过 CDN 接口发送名片。
python
wechat.send_card_by_cdn(client_id, to_wxid, username, nickname, avatar)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 接收者wxid |
| username | str | 名片用户名 |
| nickname | str | 名片昵称 |
| avatar | str | 头像URL |
send_link_card_by_cdn
通过 CDN 接口发送链接卡片。
python
wechat.send_link_card_by_cdn(client_id, to_wxid, title, desc, url, image_url)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 接收者wxid |
| title | str | 标题 |
| desc | str | 描述 |
| url | str | 链接地址 |
| image_url | str | 封面图地址 |
send_image_by_cdn
通过 CDN 接口发送图片。
python
wechat.send_image_by_cdn(client_id, to_wxid, file_id, file_md5, file_size, thumb_file_size, crc32, aes_key)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 接收者wxid |
| file_id | str | CDN文件ID |
| file_md5 | str | 文件MD5 |
| file_size | int | 文件大小 |
| thumb_file_size | int | 缩略图大小 |
| crc32 | int | CRC32校验值 |
| aes_key | str | AES密钥 |
send_video_by_cdn
通过 CDN 接口发送视频。
python
wechat.send_video_by_cdn(client_id, to_wxid, file_id, file_md5, file_size, thumb_file_size, aes_key)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 接收者wxid |
| file_id | str | CDN文件ID |
| file_md5 | str | 文件MD5 |
| file_size | int | 文件大小 |
| thumb_file_size | int | 缩略图大小 |
| aes_key | str | AES密钥 |
send_file_by_cdn
通过 CDN 接口发送文件。
python
wechat.send_file_by_cdn(client_id, to_wxid, file_id, file_md5, file_size, file_name, aes_key)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 接收者wxid |
| file_id | str | CDN文件ID |
| file_md5 | str | 文件MD5 |
| file_size | int | 文件大小 |
| file_name | str | 文件名 |
| aes_key | str | AES密钥 |
send_emotion_by_cdn
通过 CDN 接口发送动图。
python
wechat.send_emotion_by_cdn(client_id, to_wxid, path)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 接收者wxid |
| path | str | 表情路径 |
send_emotion2_by_cdn
通过 CDN 接口发送动图/表情(方式二)。
python
wechat.send_emotion2_by_cdn(client_id, aes_key, file_id, file_md5, file_size, to_wxid)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| aes_key | str | AES密钥 |
| file_id | str | CDN文件ID |
| file_md5 | str | 文件MD5 |
| file_size | int | 文件大小 |
| to_wxid | str | 接收者wxid |
send_location_by_cdn
通过 CDN 接口发送位置。
python
wechat.send_location_by_cdn(client_id, to_wxid, address, latitude, longitude, title)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 接收者wxid |
| address | str | 详细地址 |
| latitude | float | 纬度 |
| longitude | float | 经度 |
| title | str | 位置名称 |
send_mini_program_by_cdn
通过 CDN 接口发送小程序。
python
wechat.send_mini_program_by_cdn(client_id, to_wxid, username, appid, appname, appicon, title, page_path, aes_key, file_id, file_md5, file_size)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 接收者wxid |
| username | str | 小程序用户名 |
| appid | str | 小程序AppID |
| appname | str | 小程序名称 |
| appicon | str | 小程序图标 |
| title | str | 标题 |
| page_path | str | 页面路径 |
| aes_key | str | AES密钥 |
| file_id | str | CDN文件ID |
| file_md5 | str | 文件MD5 |
| file_size | int | 文件大小 |
send_video_card_by_cdn
通过 CDN 接口发送视频号卡片。
python
wechat.send_video_card_by_cdn(client_id, to_wxid, object_id, object_nonce_id, nickname, username, avatar, desc, thumb_url, url)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 接收者wxid |
| object_id | str | 视频对象ID |
| object_nonce_id | str | 视频Nonce ID |
| nickname | str | 博主昵称 |
| username | str | 博主用户名 |
| avatar | str | 博主头像 |
| desc | str | 视频描述 |
| thumb_url | str | 缩略图URL |
| url | str | 视频URL |
send_xml_by_cdn
通过 CDN 接口发送 XML 原始消息。
python
wechat.send_xml_by_cdn(client_id, to_wxid, content)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 接收者wxid |
| content | str | XML内容 |
revoke_msg_by_cdn
通过 CDN 接口撤回消息。
python
wechat.revoke_msg_by_cdn(client_id, to_wxid, new_msg_id, client_msg_id, create_time)| 参数 | 类型 | 说明 |
|---|---|---|
| client_id | int | 客户端ID |
| to_wxid | str | 接收者wxid |
| new_msg_id | str | 新消息ID |
| client_msg_id | int | 客户端消息ID |
| create_time | int | 创建时间 |