Appearance
消息发送
send_text
发送文本消息。
python
result = wework.send_text(
client_id: int,
conversation_id: str,
content: str
)| 参数 | 类型 | 说明 |
|---|---|---|
client_id | int | 客户端 ID |
conversation_id | str | 会话 ID |
content | str | 文本内容 |
对应 type: 11029
send_room_at
发送群@消息。
python
result = wework.send_room_at(
client_id: int,
conversation_id: str,
content: str,
at_list: List[str]
)| 参数 | 类型 | 说明 |
|---|---|---|
client_id | int | 客户端 ID |
conversation_id | str | 群聊会话 ID |
content | str | 消息内容 |
at_list | List[str] | @的用户 ID 列表 |
对应 type: 11069
send_image
发送图片消息。
python
result = wework.send_image(
client_id: int,
conversation_id: str,
file: str
)| 参数 | 类型 | 说明 |
|---|---|---|
client_id | int | 客户端 ID |
conversation_id | str | 会话 ID |
file | str | 图片文件路径 |
对应 type: 11030
send_file
发送文件消息。
python
result = wework.send_file(
client_id: int,
conversation_id: str,
file: str
)| 参数 | 类型 | 说明 |
|---|---|---|
client_id | int | 客户端 ID |
conversation_id | str | 会话 ID |
file | str | 文件路径 |
对应 type: 11031
send_gif
发送动图消息。
python
result = wework.send_gif(
client_id: int,
conversation_id: str,
file: str
)| 参数 | 类型 | 说明 |
|---|---|---|
client_id | int | 客户端 ID |
conversation_id | str | 会话 ID |
file | str | GIF 文件路径 |
对应 type: 11070
send_video
发送视频消息。
python
result = wework.send_video(
client_id: int,
conversation_id: str,
file: str
)| 参数 | 类型 | 说明 |
|---|---|---|
client_id | int | 客户端 ID |
conversation_id | str | 会话 ID |
file | str | 视频文件路径 |
对应 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_id | int | 客户端 ID |
conversation_id | str | 会话 ID |
file_id | str | 文件 ID(需先上传到 CDN) |
size | int | 文件大小 |
aes_key | str | AES 密钥 |
md5 | str | 文件 MD5 |
对应 type: 11141
send_link_card
发送链接卡片消息。
python
result = wework.send_link_card(
client_id: int,
conversation_id: str,
title: str,
desc: str,
url: str,
image_url: str
)| 参数 | 类型 | 说明 |
|---|---|---|
client_id | int | 客户端 ID |
conversation_id | str | 会话 ID |
title | str | 标题 |
desc | str | 描述 |
url | str | 链接地址 |
image_url | str | 封面图片 URL |
对应 type: 11159
send_card
发送名片消息。
python
result = wework.send_card(
client_id: int,
conversation_id: str,
share_user_id: str
)| 参数 | 类型 | 说明 |
|---|---|---|
client_id | int | 客户端 ID |
conversation_id | str | 会话 ID |
share_user_id | str | 要分享的用户 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_id | int | 客户端 ID |
conversation_id | str | 会话 ID |
username | str | 小程序用户名 |
appid | str | 小程序 AppID |
appname | str | 小程序名称 |
appicon | str | 小程序图标 URL |
title | str | 卡片标题 |
page_path | str | 小程序页面路径 |
file_id | str | 封面图文件 ID |
aes_key | str | AES 密钥 |
md5 | str | 文件 MD5 |
size | int | 文件大小 |
对应 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