Skip to content

Commit

Permalink
doc: 完善sdk文档
Browse files Browse the repository at this point in the history
  • Loading branch information
zoswing committed Dec 21, 2021
1 parent 76106a9 commit f4e8042
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 20 deletions.
15 changes: 11 additions & 4 deletions docs/.vuepress/config.js
Expand Up @@ -67,6 +67,16 @@ module.exports = {
},
},
],
[
'vuepress-plugin-right-anchor',
{
showDepth: 1,
expand: {
trigger: 'hover',
clickModeDefaultOpen: true,
},
},
],
['vuepress-plugin-baidu-autopush'],
['@vuepress/pwa'],
],
Expand Down Expand Up @@ -103,10 +113,6 @@ module.exports = {
text: '机器人平台',
link: 'https://bot.q.qq.com/open',
},
{
text: 'GitHub',
link: 'https://github.com/tencent-connect',
},
],
repo: 'tencent-connect/bot-docs',
editLinks: true,
Expand All @@ -118,6 +124,7 @@ module.exports = {
...nodesdkConfig.sidebar,
'/': [''],
},

plugins: [
[
'@vuepress/search',
Expand Down
6 changes: 6 additions & 0 deletions docs/develop/nodesdk/README.md
Expand Up @@ -120,6 +120,12 @@ client.messageApi
}
```

::: tip 提示

针对返回失败的情况,可查看[错误状态码](../api/openapi/error/error.md#错误处理)描述。

:::

### 使用 ws

`ws`用于频道内消息监听,**如要使用`client`向指定子频道发送消息,必选先建立 ws 连接**
Expand Down
30 changes: 15 additions & 15 deletions docs/develop/nodesdk/config.js
Expand Up @@ -6,6 +6,21 @@ module.exports = {
sidebar: {
'/develop/nodesdk/': [
'',
{
title: '术语',
collapsable: false,
sidebarDepth: 0,
children: [
{ title: '用户对象(User)', path: 'model/user' },
{ title: '频道对象(Guild)', path: 'model/guild' },
{ title: '子频道对象(Channel)', path: 'model/channel' },
{ title: '子频道权限对象(ChannelPermissions)', path: 'model/channel_permission' },
{ title: '成员对象(Member)', path: 'model/member' },
{ title: '频道身份组对象(Role)', path: 'model/role' },
{ title: '消息对象(Message)', path: 'model/message' },
{ title: '语音对象(Audio)', path: 'model/audio' },
],
},
{
title: 'Client API',
collapsable: false,
Expand Down Expand Up @@ -100,21 +115,6 @@ module.exports = {
sidebarDepth: 0,
children: [{ title: 'wss 消息体', path: 'wss/model.md' }],
},
{
title: '术语',
collapsable: false,
sidebarDepth: 0,
children: [
{ title: '用户对象(User)', path: 'model/user' },
{ title: '频道对象(Guild)', path: 'model/guild' },
{ title: '子频道对象(Channel)', path: 'model/channel' },
{ title: '子频道权限对象(ChannelPermissions)', path: 'model/channel_permission' },
{ title: '成员对象(Member)', path: 'model/member' },
{ title: '频道身份组对象(Role)', path: 'model/role' },
{ title: '消息对象(Message)', path: 'model/message' },
{ title: '语音对象(Audio)', path: 'model/audio' },
],
},
],
},
};
11 changes: 10 additions & 1 deletion docs/develop/nodesdk/message/post_messages.md
Expand Up @@ -56,7 +56,16 @@ async function demo() {

## 返回说明

返回[Message](#message) 对象。
主动消息都需要审核,返回结果如下:

```json
{
"code": 304023,
"message": "push message is waiting for audit now"
}
```

若为私域机器人可正常返回[Message](#message) 对象。

### Message

Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -31,6 +31,7 @@
"vuepress-plugin-baidu-autopush": "^1.0.1",
"vuepress-plugin-fulltext-search": "^2.2.1",
"vuepress-plugin-one-click-copy": "^1.0.6",
"vuepress-plugin-right-anchor": "^0.5.5",
"vuepress-plugin-robots": "^1.0.1",
"vuepress-plugin-sitemap": "^2.3.1",
"vuepress-plugin-zooming": "^1.1.8"
Expand Down

0 comments on commit f4e8042

Please sign in to comment.