Skip to content

消息发送

send_text

发送文本消息。

python
result = wework.send_text(
    client_id: int,
    conversation_id: str,
    content: str
)
参数类型说明
client_idint客户端 ID
conversation_idstr会话 ID
contentstr文本内容

对应 type: 11029

send_room_at

发送群@消息。

python
result = wework.send_room_at(
    client_id: int,
    conversation_id: str,
    content: str,
    at_list: List[str]
)
参数类型说明
client_idint客户端 ID
conversation_idstr群聊会话 ID
contentstr消息内容
at_listList[str]@的用户 ID 列表

对应 type: 11069

send_image

发送图片消息。

python
result = wework.send_image(
    client_id: int,
    conversation_id: str,
    file: str
)
参数类型说明
client_idint客户端 ID
conversation_idstr会话 ID
filestr图片文件路径

对应 type: 11030

send_file

发送文件消息。

python
result = wework.send_file(
    client_id: int,
    conversation_id: str,
    file: str
)
参数类型说明
client_idint客户端 ID
conversation_idstr会话 ID
filestr文件路径

对应 type: 11031

send_gif

发送动图消息。

python
result = wework.send_gif(
    client_id: int,
    conversation_id: str,
    file: str
)
参数类型说明
client_idint客户端 ID
conversation_idstr会话 ID
filestrGIF 文件路径

对应 type: 11070

send_video

发送视频消息。

python
result = wework.send_video(
    client_id: int,
    conversation_id: str,
    file: str
)
参数类型说明
client_idint客户端 ID
conversation_idstr会话 ID
filestr视频文件路径

对应 type: 11067

send_voice

发送语音消息。

python
result = wework.send_voice(
    client_id: int,
    conversation_id: str,
    file_id: str,
    size: int,
    aes_key: str,
    md5: str
)
参数类型说明
client_idint客户端 ID
conversation_idstr会话 ID
file_idstr文件 ID(需先上传到 CDN)
sizeint文件大小
aes_keystrAES 密钥
md5str文件 MD5

对应 type: 11141

发送链接卡片消息。

python
result = wework.send_link_card(
    client_id: int,
    conversation_id: str,
    title: str,
    desc: str,
    url: str,
    image_url: str
)
参数类型说明
client_idint客户端 ID
conversation_idstr会话 ID
titlestr标题
descstr描述
urlstr链接地址
image_urlstr封面图片 URL

对应 type: 11159

send_card

发送名片消息。

python
result = wework.send_card(
    client_id: int,
    conversation_id: str,
    share_user_id: str
)
参数类型说明
client_idint客户端 ID
conversation_idstr会话 ID
share_user_idstr要分享的用户 ID

对应 type: 11161

send_mini_app

发送小程序卡片。

python
result = wework.send_mini_app(
    client_id: int,
    conversation_id: str,
    username: str,
    appid: str,
    appname: str,
    appicon: str,
    title: str,
    page_path: str,
    file_id: str,
    aes_key: str,
    md5: str,
    size: int
)
参数类型说明
client_idint客户端 ID
conversation_idstr会话 ID
usernamestr小程序用户名
appidstr小程序 AppID
appnamestr小程序名称
appiconstr小程序图标 URL
titlestr卡片标题
page_pathstr小程序页面路径
file_idstr封面图文件 ID
aes_keystrAES 密钥
md5str文件 MD5
sizeint文件大小

对应 type: 11162

send_channel_video

转发视频号内容。

python
result = wework.send_channel_video(
    client_id: int,
    conversation_id: str,
    avatar: str,
    cover_url: str,
    desc: str,
    nickname: str,
    thumb_url: str,
    url: str,
    extras: str
)

对应 type: 11172

send_channel_live

转发视频号直播。

python
result = wework.send_channel_live(
    client_id: int,
    conversation_id: str,
    avatar: str,
    cover_url: str,
    desc: str,
    nickname: str,
    object_id: str,
    object_nonce_id: str,
    thumb_url: str,
    url: str,
    extras: str
)

对应 type: 11196

Released under the MIT License.