@mrlingxd/koishi-plugin-adapter-onebot 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/bot/index.js CHANGED
@@ -43,7 +43,7 @@ export class OneBot extends Bot {
43
43
  const data = await this.internal.getLoginInfo();
44
44
  this.user = {
45
45
  id: data.user_id.toString(),
46
- username: data.nickname,
46
+ name: data.nickname,
47
47
  avatar: `http://q.qlogo.cn/headimg_dl?dst_uin=${data.user_id}&spec=640`,
48
48
  isBot: true
49
49
  };
package/lib/ws.js CHANGED
@@ -56,6 +56,7 @@ export class WsServer extends Adapter {
56
56
  ctx.on("dispose", () => {
57
57
  this.logger.debug("ws server closing");
58
58
  this.wsServer.close();
59
+ this.disconnect(bot);
59
60
  });
60
61
  }
61
62
  async disconnect(bot) {
@@ -94,6 +95,7 @@ export function accept(socket, bot) {
94
95
  Object.keys(listeners).forEach((echo) => {
95
96
  delete listeners[Number(echo)];
96
97
  });
98
+ bot.adapter.disconnect(bot);
97
99
  });
98
100
  bot.internal._request = (action, params) => {
99
101
  const echo = ++counter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrlingxd/koishi-plugin-adapter-onebot",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "OneBot Adapter for Koishi",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -8,16 +8,16 @@
8
8
  "lib"
9
9
  ],
10
10
  "contributors": [
11
- "MrlingXD <90316914+wling-art@users.noreply.github.com>"
11
+ "MrlingXD <90316914+CrashVibe@users.noreply.github.com>"
12
12
  ],
13
13
  "license": "MIT",
14
- "homepage": "https://github.com/wling-art/koishi-plugin-adapter-onebot",
14
+ "homepage": "https://github.com/CrashVibe/koishi-plugin-adapter-onebot",
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "git+https://github.com/wling-art/koishi-plugin-adapter-onebot.git"
17
+ "url": "git+https://github.com/CrashVibe/koishi-plugin-adapter-onebot.git"
18
18
  },
19
19
  "bugs": {
20
- "url": "https://github.com/wling-art/koishi-plugin-adapter-onebot/issues"
20
+ "url": "https://github.com/CrashVibe/koishi-plugin-adapter-onebot/issues"
21
21
  },
22
22
  "keywords": [
23
23
  "bot",
package/readme.md CHANGED
@@ -51,94 +51,6 @@
51
51
 
52
52
  你可以通过 `bot.internal` 或 `session.onebot` 访问内部 API,参见 [访问内部接口](https://koishi.chat/zh-CN/guide/adapter/bot.html#internal-access)。
53
53
 
54
- ### OneBot v11 标准 API
55
-
56
- - [`onebot.sendPrivateMsg()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#send_private_msg-发送私聊消息)
57
- - [`onebot.sendGroupMsg()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#send_group_msg-发送群消息)
58
- - [`onebot.deleteMsg()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#delete_msg-撤回消息)
59
- - [`onebot.getMsg()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_msg-获取消息)
60
- - [`onebot.getForwardMsg()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_forward_msg-获取合并转发消息)
61
- - [`onebot.sendLike()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#send_like-发送好友赞)
62
- - [`onebot.setGroupKick()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_group_kick-群组踢人)
63
- - [`onebot.setGroupBan()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_group_ban-群组单人禁言)
64
- - [`onebot.setGroupAnonymousBan()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_group_anonymous_ban-群组匿名用户禁言)
65
- - [`onebot.setGroupWholeBan()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_group_whole_ban-群组全员禁言)
66
- - [`onebot.setGroupAdmin()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_group_admin-群组设置管理员)
67
- - [`onebot.setGroupAnonymous()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_group_anonymous-群组匿名)
68
- - [`onebot.setGroupCard()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_group_card-设置群名片群备注)
69
- - [`onebot.setGroupName()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_group_name-设置群名)
70
- - [`onebot.setGroupLeave()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_group_leave-退出群组)
71
- - [`onebot.setGroupSpecialTitle()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_group_special_title-设置群组专属头衔)
72
- - [`onebot.setFriendAddRequest()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_friend_add_request-处理加好友请求)
73
- - [`onebot.setGroupAddRequest()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_group_add_request-处理加群请求邀请)
74
- - [`onebot.getLoginInfo()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_login_info-获取登录号信息)
75
- - [`onebot.getStrangerInfo()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_stranger_info-获取陌生人信息)
76
- - [`onebot.getFriendList()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_friend_list-获取好友列表)
77
- - [`onebot.getGroupInfo()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_group_info-获取群信息)
78
- - [`onebot.getGroupList()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_group_list-获取群列表)
79
- - [`onebot.getGroupMemberInfo()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_group_member_info-获取群成员信息)
80
- - [`onebot.getGroupMemberList()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_group_member_list-获取群成员列表)
81
- - [`onebot.getGroupHonorInfo()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_group_honor_info-获取群荣誉信息)
82
- - [`onebot.getCookies()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_cookies-获取-cookies)
83
- - [`onebot.getCsrfToken()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_csrf_token-获取-csrf-token)
84
- - [`onebot.getCredentials()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_credentials-获取-qq-相关接口凭证)
85
- - [`onebot.getRecord()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_record-获取语音)
86
- - [`onebot.getImage()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_image-获取图片)
87
- - [`onebot.canSendImage()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#can_send_image-检查是否可以发送图片)
88
- - [`onebot.canSendRecord()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#can_send_record-检查是否可以发送语音)
89
- - [`onebot.getStatus()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_status-获取运行状态)
90
- - [`onebot.getVersionInfo()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_version_info-获取版本信息)
91
- - [`onebot.setRestart()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_restart-重启-onebot-实现)
92
- - [`onebot.cleanCache()`](https://github.com/botuniverse/onebot-11/blob/master/api/public.md#clean_cache-清理缓存)
93
-
94
- ### go-cqhttp 扩展 API
95
-
96
- - [`onebot.sendGroupForwardMsg()`](https://docs.go-cqhttp.org/api/#发送合并转发-群聊)
97
- - [`onebot.markMsgAsRead()`](https://docs.go-cqhttp.org/api/#标记消息已读)
98
- - [`onebot.sendGroupSign()`](https://docs.go-cqhttp.org/api/#群打卡)
99
- - [`onebot.qidianGetAccountInfo()`](https://docs.go-cqhttp.org/api/#获取企点账号信息)
100
- - [`onebot.setQqProfile()`](https://docs.go-cqhttp.org/api/#设置登录号资料)
101
- - [`onebot.getUnidirectionalFriendList()`](https://docs.go-cqhttp.org/api/#获取单向好友列表)
102
- - [`onebot.deleteFriend()`](https://docs.go-cqhttp.org/api/#删除好友)
103
- - [`onebot.setGroupPortrait()`](https://docs.go-cqhttp.org/api/#设置群头像)
104
- - [`onebot.getWordSlices()`](https://docs.go-cqhttp.org/api/#获取中文分词-隐藏-api)
105
- - [`onebot.ocrImage()`](https://docs.go-cqhttp.org/api/#图片-ocr)
106
- - [`onebot.getGroupSystemMsg()`](https://docs.go-cqhttp.org/api/#获取群系统消息)
107
- - [`onebot.uploadPrivateFile()`](https://docs.go-cqhttp.org/api/#上传私聊文件)
108
- - [`onebot.uploadGroupFile()`](https://docs.go-cqhttp.org/api/#上传群文件)
109
- - [`onebot.getGroupFileSystemInfo()`](https://docs.go-cqhttp.org/api/#获取群文件系统信息)
110
- - [`onebot.getGroupRootFiles()`](https://docs.go-cqhttp.org/api/#获取群根目录文件列表)
111
- - [`onebot.getGroupFilesByFolder()`](https://docs.go-cqhttp.org/api/#获取群子目录文件列表)
112
- - [`onebot.createGroupFileFolder()`](https://docs.go-cqhttp.org/api/#创建群文件文件夹)
113
- - [`onebot.deleteGroupFolder()`](https://docs.go-cqhttp.org/api/#删除群文件文件夹)
114
- - [`onebot.deleteGroupFile()`](https://docs.go-cqhttp.org/api/#删除群文件)
115
- - [`onebot.getGroupFileUrl()`](https://docs.go-cqhttp.org/api/#获取群文件资源链接)
116
- - [`onebot.getGroupAtAllRemain()`](https://docs.go-cqhttp.org/api/#获取群-全体成员-剩余次数)
117
- - [`onebot.getVipInfo()`](https://github.com/Mrs4s/go-cqhttp/blob/master/docs/cqhttp.md?plain=1#L1081)
118
- - [`onebot.sendGroupNotice()`](https://docs.go-cqhttp.org/api/#发送群公告)
119
- - [`onebot.getGroupNotice()`](https://docs.go-cqhttp.org/api/#获取群公告)
120
- - [`onebot.reloadEventFilter()`](https://docs.go-cqhttp.org/api/#重载事件过滤器)
121
- - [`onebot.downloadFile()`](https://docs.go-cqhttp.org/api/#下载文件到缓存目录)
122
- - [`onebot.getOnlineClients()`](https://docs.go-cqhttp.org/api/#获取当前账号在线客户端列表)
123
- - [`onebot.getGroupMsgHistory()`](https://docs.go-cqhttp.org/api/#获取群消息历史记录)
124
- - [`onebot.setEssenceMsg()`](https://docs.go-cqhttp.org/api/#设置精华消息)
125
- - [`onebot.deleteEssenceMsg()`](https://docs.go-cqhttp.org/api/#移出精华消息)
126
- - [`onebot.getEssenceMsgList()`](https://docs.go-cqhttp.org/api/#获取精华消息列表)
127
- - [`onebot.checkUrlSafely()`](https://docs.go-cqhttp.org/api/#检查链接安全性)
128
- - [`onebot.getModelShow()`](https://docs.go-cqhttp.org/api/#获取在线机型)
129
- - [`onebot.setModelShow()`](https://docs.go-cqhttp.org/api/#设置在线机型)
130
- - [`onebot.delete_unidirectional_friend()`](https://docs.go-cqhttp.org/api/#删除单向好友)
131
- - [`onebot.send_private_forward_msg()`](https://docs.go-cqhttp.org/api/#发送合并转发-好友)
132
-
133
- ### 频道 API
134
-
135
- - [`onebot.getGuildServiceProfile()`](https://docs.go-cqhttp.org/api/guild.html#获取频道系统内bot的资料)
136
- - [`onebot.getGuildList()`](https://docs.go-cqhttp.org/api/guild.html#获取频道列表)
137
- - [`onebot.getGuildMetaByGuest()`](https://docs.go-cqhttp.org/api/guild.html#通过访客获取频道元数据)
138
- - [`onebot.getGuildChannelList()`](https://docs.go-cqhttp.org/api/guild.html#获取子频道列表)
139
- - [`onebot.getGuildMembers()`](https://docs.go-cqhttp.org/api/guild.html#获取频道成员列表)
140
- - [`onebot.sendGuildChannelMsg()`](https://docs.go-cqhttp.org/api/guild.html#发送信息到子频道)
141
-
142
54
  ## 许可证
143
55
 
144
56
  使用 [MIT](./LICENSE) 许可证发布。