Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Commit ae12652

Browse files
Merge pull request #38 from takayama-lily/dev
-
2 parents 1aa8396 + 415fe5a commit ae12652

File tree

9 files changed

+532
-275
lines changed

9 files changed

+532
-275
lines changed

client.js

Lines changed: 77 additions & 133 deletions
Large diffs are not rendered by default.

docs/api.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
+ [client.captchaLogin(captcha)](#client.captchaLogin(captcha))
1212
+ [client.terminate()](#client.terminate())
1313
+ [APIs](#APIs)
14+
+ [获取列表](#获取好友群群员列表和info)
15+
+ [发消息和撤回](#发私聊消息群消息)
16+
+ [群操作](#群操作踢人禁言退群设置等)
17+
+ [加好友](#加好友删好友邀请好友入群点赞)
18+
+ [设置状态和资料](#设置状态和资料)
1419
+ [oicq.setGlobalConfig(config)](#oicq.setGlobalConfig(config))
1520

1621
----
@@ -187,14 +192,18 @@ client.on("system.login.captcha", (data)=>{
187192
+ *`user_id`*
188193
+ *`message_id`*
189194

195+
+ `notice.friend.nickname` 好友更新昵称
196+
+ *`user_id`*
197+
+ *`nickname`*
198+
190199
+ **notice.group**
191200

192201
+ `notice.group.increase` 群员增加
193202
+ *`group_id`*
194203
+ *`user_id`*
195204
+ *`nickname`*
196205

197-
+ `notice.group.decrease` 群员减少(bot在其他客户端自己退群,事件不会触发)
206+
+ `notice.group.decrease` 群员减少
198207
+ *`group_id`*
199208
+ *`operator_id`* 操作者,自己退群的时候和user_id相同
200209
+ *`user_id`*
@@ -206,7 +215,7 @@ client.on("system.login.captcha", (data)=>{
206215
+ *`user_id`*
207216
+ *`message_id`*
208217

209-
+ `notice.group.admin` 管理变更事件(bot是群主,在其他客户端设置管理,事件不会触发)
218+
+ `notice.group.admin` 管理变更事件
210219
+ *`group_id`*
211220
+ *`user_id`*
212221
+ *`set`* boolean型
@@ -311,9 +320,9 @@ client.on("system.login.captcha", (data)=>{
311320

312321
### 获取好友、群、群员列表和info
313322

314-
+ async `client.getFriendList([no_cache])`
315-
+ async `client.getGroupList([no_cache])`
316-
+ async `client.getGroupMemberList(group_id[, no_cache])`
323+
+ `client.getFriendList()`
324+
+ `client.getGroupList()`
325+
+ async `client.getGroupMemberList(group_id)`
317326
+ 获取列表返回的是ES6的Map类型,不是数组
318327
+ async `client.getGroupInfo(group_id[, no_cache])`
319328
+ async `client.getGroupMemberInfo(group_id, user_id[, no_cache])`
@@ -355,7 +364,7 @@ message可以使用 `Array` 格式或 `String` 格式,支持CQ码
355364

356365
----
357366

358-
## 加好友、删好友、邀请好友入群、点赞
367+
### 加好友、删好友、邀请好友入群、点赞
359368

360369
+ async `client.addFriend(group_id, user_id[, comment])`
361370
+ async `client.deleteFriend(user_id[, block])` block(屏蔽)默认是true
@@ -364,7 +373,7 @@ message可以使用 `Array` 格式或 `String` 格式,支持CQ码
364373

365374
----
366375

367-
## 设置状态和资料
376+
### 设置状态和资料
368377

369378
+ async `client.setOnlineStatus(status)` 仅支持手机协议
370379
+ `status` 允许的值:11我在线上 31离开 41隐身 50忙碌 60Q我吧 70请勿打扰
@@ -376,7 +385,7 @@ message可以使用 `Array` 格式或 `String` 格式,支持CQ码
376385

377386
----
378387

379-
## 其他
388+
### 其他
380389

381390
+ `client.canSendImage()`
382391
+ `client.canSendRecord()`

lib/common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function toInt(uin) {
8484
* @returns {Boolean}
8585
*/
8686
function checkUin(uin) {
87-
return uin > 10000 && uin < 0xffffffff;
87+
return uin >= 10000 && uin <= 0xffffffff;
8888
}
8989

9090
function code2uin(groupCode) {
@@ -125,7 +125,7 @@ function uin2code(groupUin) {
125125
}
126126

127127
function log(any) {
128-
console.log(util.inspect(any, {depth: 20, showHidden: true, maxArrayLength: 1000, maxStringLength: 1000}));
128+
console.log(util.inspect(any, {depth: 20, showHidden: false, maxArrayLength: 1000, maxStringLength: 5000}));
129129
}
130130

131131
module.exports = {

0 commit comments

Comments
 (0)