Skip to content

CDN 消息

CDN 消息接口使用 CDN 参数发送消息,适用于转发其他账号收到的媒体消息。

send_text_by_cdn

通过 CDN 接口发送文本消息。

python
wechat.send_text_by_cdn(client_id, to_wxid, content)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
contentstr文本内容

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_idint客户端ID
to_wxidstr群wxid
contentstr消息内容
at_listlist@的成员wxid列表
at_allint是否@所有人 (0/1)

send_card_by_cdn

通过 CDN 接口发送名片。

python
wechat.send_card_by_cdn(client_id, to_wxid, username, nickname, avatar)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
usernamestr名片用户名
nicknamestr名片昵称
avatarstr头像URL

通过 CDN 接口发送链接卡片。

python
wechat.send_link_card_by_cdn(client_id, to_wxid, title, desc, url, image_url)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
titlestr标题
descstr描述
urlstr链接地址
image_urlstr封面图地址

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_idint客户端ID
to_wxidstr接收者wxid
file_idstrCDN文件ID
file_md5str文件MD5
file_sizeint文件大小
thumb_file_sizeint缩略图大小
crc32intCRC32校验值
aes_keystrAES密钥

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_idint客户端ID
to_wxidstr接收者wxid
file_idstrCDN文件ID
file_md5str文件MD5
file_sizeint文件大小
thumb_file_sizeint缩略图大小
aes_keystrAES密钥

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_idint客户端ID
to_wxidstr接收者wxid
file_idstrCDN文件ID
file_md5str文件MD5
file_sizeint文件大小
file_namestr文件名
aes_keystrAES密钥

send_emotion_by_cdn

通过 CDN 接口发送动图。

python
wechat.send_emotion_by_cdn(client_id, to_wxid, path)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
pathstr表情路径

send_emotion2_by_cdn

通过 CDN 接口发送动图/表情(方式二)。

python
wechat.send_emotion2_by_cdn(client_id, aes_key, file_id, file_md5, file_size, to_wxid)
参数类型说明
client_idint客户端ID
aes_keystrAES密钥
file_idstrCDN文件ID
file_md5str文件MD5
file_sizeint文件大小
to_wxidstr接收者wxid

send_location_by_cdn

通过 CDN 接口发送位置。

python
wechat.send_location_by_cdn(client_id, to_wxid, address, latitude, longitude, title)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
addressstr详细地址
latitudefloat纬度
longitudefloat经度
titlestr位置名称

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_idint客户端ID
to_wxidstr接收者wxid
usernamestr小程序用户名
appidstr小程序AppID
appnamestr小程序名称
appiconstr小程序图标
titlestr标题
page_pathstr页面路径
aes_keystrAES密钥
file_idstrCDN文件ID
file_md5str文件MD5
file_sizeint文件大小

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_idint客户端ID
to_wxidstr接收者wxid
object_idstr视频对象ID
object_nonce_idstr视频Nonce ID
nicknamestr博主昵称
usernamestr博主用户名
avatarstr博主头像
descstr视频描述
thumb_urlstr缩略图URL
urlstr视频URL

send_xml_by_cdn

通过 CDN 接口发送 XML 原始消息。

python
wechat.send_xml_by_cdn(client_id, to_wxid, content)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
contentstrXML内容

revoke_msg_by_cdn

通过 CDN 接口撤回消息。

python
wechat.revoke_msg_by_cdn(client_id, to_wxid, new_msg_id, client_msg_id, create_time)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
new_msg_idstr新消息ID
client_msg_idint客户端消息ID
create_timeint创建时间

基于 MIT 许可证发布