码
DR码指框架中特殊消息的文本格式,适用于消息发送以及消息接收
基本语法
[DR:类型, 参数1=值1, 参数2=值2]艾特码
类型
at
参数
| 字段 | 类型 | 是否必传 | 说明 |
|---|---|---|---|
| id | string | 是 | 用户号,为all时,则表示艾特全体成员 |
示例
[DR:at, id=123456]表情码
类型
emoji
参数
| 字段 | 类型 | 是否必传 | 说明 |
|---|---|---|---|
| id | string | 是 | 表情ID |
| type | int | 否 | 表情类型 |
示例
[DR:emoji, type=0, id=爱情]图片码
类型
image
参数
| 字段 | 类型 | 是否必传 | 说明 |
|---|---|---|---|
| file | string | 是 | 文件路径,本地路径 / 网址 |
| width | long | 否 | 图片宽度 |
| height | long | 否 | 图片高度 |
示例
[DR:image, file=http://oss.drea.cc/res/xxx.png, width=1920, height=1080]视频码
类型
video
参数
| 字段 | 类型 | 是否必传 | 说明 |
|---|---|---|---|
| file | string | 是 | 文件路径,本地路径 / 网址 |
| duration | long | 否 | 视频时长 |
| size | long | 否 | 视频大小 |
示例
[DR:video, file=http://oss.drea.cc/res/xxx.mp4, duration=20000, size=1000000]文件码
类型
file
参数
| 字段 | 类型 | 是否必传 | 说明 |
|---|---|---|---|
| file | string | 是 | 文件路径,本地路径 / 网址 |
| name | string | 否 | 文件名称 |
| size | long | 否 | 文件大小 |
示例
[DR:file, file=http://oss.drea.cc/res/xxx.txt, name=test, size=1000000]语音码
类型
record
参数
| 字段 | 类型 | 是否必传 | 说明 |
|---|---|---|---|
| file | string | 是 | 文件路径,本地路径 / 网址 |
示例
[DR:record, file=http://oss.drea.cc/res/xxx.mp3]音乐码
类型
music
参数
| 字段 | 类型 | 是否必传 | 说明 |
|---|---|---|---|
| id | string | 是 | 音乐ID |
| type | string | 否 | 音乐类型 |
示例
[DR:music, type=0, id=10000]卡片码
类型
card
参数
| 字段 | 类型 | 是否必传 | 说明 |
|---|---|---|---|
| type | string | 是 | 卡片类型 |
| title | string | 是 | 标题 |
| content | string | 是 | 内容 |
| image | string | 是 | 图片 |
| url | string | 是 | 链接 |
示例
[DR:card, type=0, title=标题, content=内容, image=http://oss.drea.cc/res/xxx.png, url=http://drea.cc]