Skip to content

消息发送

send_text

发送文本消息。

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

send_room_at

发送群聊@消息。

python
wechat.send_room_at(client_id, to_wxid, content, at_list)
参数类型说明
client_idint客户端ID
to_wxidstr群wxid
contentstr消息内容
at_listList[str]@的成员wxid列表

send_card

发送名片消息。

python
wechat.send_card(client_id, to_wxid, card_wxid)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
card_wxidstr名片用户wxid

发送链接卡片消息。

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

send_image

发送图片消息。

python
wechat.send_image(client_id, to_wxid, file)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
filestr图片文件路径

send_file

发送文件消息。

python
wechat.send_file(client_id, to_wxid, file)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
filestr文件路径

send_video

发送视频消息。

python
wechat.send_video(client_id, to_wxid, file)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
filestr视频文件路径

send_emotion

发送动图/表情消息。

python
wechat.send_emotion(client_id, to_wxid, file)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
filestr表情文件路径

send_xml

发送 XML 原始消息。

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

send_pat

发送拍一拍消息。

python
wechat.send_pat(client_id, room_wxid, patted_wxid)
参数类型说明
client_idint客户端ID
room_wxidstr群wxid
patted_wxidstr被拍成员wxid

forward_msg

转发任意类型消息。

python
wechat.forward_msg(client_id, to_wxid, msg_id)
参数类型说明
client_idint客户端ID
to_wxidstr接收者wxid
msg_idstr消息ID

基于 MIT 许可证发布