onebots 0.0.30 → 0.1.0
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/README.md +2 -2
- package/lib/onebot.js +1 -1
- package/lib/server/app.d.ts +1 -1
- package/lib/server/app.js +2 -2
- package/lib/service/V11/action/common.js +3 -3
- package/lib/service/V11/action/friend.d.ts +1 -1
- package/lib/service/V11/action/friend.js +1 -1
- package/lib/service/V11/action/group.d.ts +1 -1
- package/lib/service/V11/action/group.js +1 -1
- package/lib/service/V12/action/friend.d.ts +1 -1
- package/lib/service/V12/action/friend.js +1 -1
- package/lib/service/V12/action/group.d.ts +1 -1
- package/lib/service/V12/action/group.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<h1>基于
|
|
2
|
+
<h1>基于icqq的oneBot实现</h1>
|
|
3
3
|
<p>
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/onebots)
|
|
@@ -79,5 +79,5 @@ node ./index.js
|
|
|
79
79
|
| /remove | get | uin,force | 移除机器人,force为true时,将删除机器人data目录 |
|
|
80
80
|
|
|
81
81
|
# 鸣谢
|
|
82
|
-
1. [takayama-lily/
|
|
82
|
+
1. [takayama-lily/icqq](https://github.com/takayama-lily/icqq) 底层服务支持
|
|
83
83
|
2. [takayama-lily/onebot](https://github.com/takayama-lily/node-onebot) oneBots原先版本
|
package/lib/onebot.js
CHANGED
|
@@ -124,7 +124,7 @@ class OneBot extends events_1.EventEmitter {
|
|
|
124
124
|
case 'group':
|
|
125
125
|
data.message.shift({
|
|
126
126
|
type: 'reply',
|
|
127
|
-
message_id: (0, message_1.genGroupMessageId)(data.group_id, data.source.user_id, data.source.seq, data.source.rand, data.source.
|
|
127
|
+
message_id: (0, message_1.genGroupMessageId)(data.group_id, data.source.user_id, data.source.seq, data.source.rand, data.source.time)
|
|
128
128
|
});
|
|
129
129
|
break;
|
|
130
130
|
case 'private':
|
package/lib/server/app.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { Router } from "./router";
|
|
|
8
8
|
import { V11 } from "../service/V11";
|
|
9
9
|
import { V12 } from "../service/V12";
|
|
10
10
|
import { LogLevel, MayBeArray } from "../types";
|
|
11
|
-
import { Platform } from "
|
|
11
|
+
import { Platform } from "icqq";
|
|
12
12
|
export interface KoaOptions {
|
|
13
13
|
env?: string;
|
|
14
14
|
keys?: string[];
|
package/lib/server/app.js
CHANGED
|
@@ -48,7 +48,7 @@ class App extends koa_1.default {
|
|
|
48
48
|
super(config);
|
|
49
49
|
this.oneBots = [];
|
|
50
50
|
this.config = (0, utils_1.deepMerge)((0, utils_1.deepClone)(App.defaultConfig), config);
|
|
51
|
-
this.logger = (0, log4js_1.getLogger)('[
|
|
51
|
+
this.logger = (0, log4js_1.getLogger)('[icqq-OneBot]');
|
|
52
52
|
this.logger.level = this.config.log_level;
|
|
53
53
|
this.router = new router_1.Router({ prefix: config.path });
|
|
54
54
|
this.use((0, koa_bodyparser_1.default)())
|
|
@@ -58,7 +58,7 @@ class App extends koa_1.default {
|
|
|
58
58
|
this.createOneBots();
|
|
59
59
|
}
|
|
60
60
|
getLogger(uin, version = '') {
|
|
61
|
-
const logger = (0, log4js_1.getLogger)(`[
|
|
61
|
+
const logger = (0, log4js_1.getLogger)(`[icqq-OneBot${version}:${uin}]`);
|
|
62
62
|
logger.level = this.config.log_level;
|
|
63
63
|
return logger;
|
|
64
64
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CommonAction = void 0;
|
|
4
|
-
const
|
|
4
|
+
const icqq_1 = require("icqq");
|
|
5
5
|
const onebot_1 = require("../../../onebot");
|
|
6
6
|
class CommonAction {
|
|
7
7
|
/**
|
|
@@ -62,7 +62,7 @@ class CommonAction {
|
|
|
62
62
|
*/
|
|
63
63
|
getVersion() {
|
|
64
64
|
return {
|
|
65
|
-
app_name: '
|
|
65
|
+
app_name: 'icqq',
|
|
66
66
|
app_version: '2.x',
|
|
67
67
|
protocol_version: 'v11'
|
|
68
68
|
};
|
|
@@ -76,7 +76,7 @@ class CommonAction {
|
|
|
76
76
|
}
|
|
77
77
|
getStatus() {
|
|
78
78
|
return {
|
|
79
|
-
online: this.client.status ===
|
|
79
|
+
online: this.client.status === icqq_1.OnlineStatus.Online,
|
|
80
80
|
good: this.oneBot.status === onebot_1.OneBotStatus.Good
|
|
81
81
|
};
|
|
82
82
|
}
|
|
@@ -5,7 +5,7 @@ export declare class FriendAction {
|
|
|
5
5
|
/**
|
|
6
6
|
* 发送私聊消息
|
|
7
7
|
* @param user_id {number} 用户id
|
|
8
|
-
* @param message {import('
|
|
8
|
+
* @param message {import('icqq').Sendable} 发送的消息
|
|
9
9
|
* @param message_id {string} 引用的消息ID
|
|
10
10
|
*/
|
|
11
11
|
sendPrivateMsg(this: V11, user_id: number, message: string | SegmentElem[], message_id?: string): Promise<import("icqq").MessageRet>;
|
|
@@ -6,7 +6,7 @@ class FriendAction {
|
|
|
6
6
|
/**
|
|
7
7
|
* 发送私聊消息
|
|
8
8
|
* @param user_id {number} 用户id
|
|
9
|
-
* @param message {import('
|
|
9
|
+
* @param message {import('icqq').Sendable} 发送的消息
|
|
10
10
|
* @param message_id {string} 引用的消息ID
|
|
11
11
|
*/
|
|
12
12
|
async sendPrivateMsg(user_id, message, message_id) {
|
|
@@ -4,7 +4,7 @@ export declare class GroupAction {
|
|
|
4
4
|
/**
|
|
5
5
|
* 发送群聊消息
|
|
6
6
|
* @param group_id {number} 群id
|
|
7
|
-
* @param message {import('
|
|
7
|
+
* @param message {import('icqq').Sendable} 消息
|
|
8
8
|
* @param message_id {string} 引用的消息ID
|
|
9
9
|
*/
|
|
10
10
|
sendGroupMsg(this: V11, group_id: number, message: string | SegmentElem[], message_id?: string): Promise<import("icqq").MessageRet>;
|
|
@@ -6,7 +6,7 @@ class GroupAction {
|
|
|
6
6
|
/**
|
|
7
7
|
* 发送群聊消息
|
|
8
8
|
* @param group_id {number} 群id
|
|
9
|
-
* @param message {import('
|
|
9
|
+
* @param message {import('icqq').Sendable} 消息
|
|
10
10
|
* @param message_id {string} 引用的消息ID
|
|
11
11
|
*/
|
|
12
12
|
async sendGroupMsg(group_id, message, message_id) {
|
|
@@ -11,7 +11,7 @@ export declare class FriendAction {
|
|
|
11
11
|
/**
|
|
12
12
|
* 发送私聊消息
|
|
13
13
|
* @param user_id {number} 用户id
|
|
14
|
-
* @param message {import('
|
|
14
|
+
* @param message {import('icqq').Sendable} 发送的消息
|
|
15
15
|
* @param message_id {string} 引用的消息ID
|
|
16
16
|
*/
|
|
17
17
|
sendPrivateMsg(this: V12, user_id: number, message: V12.SegmentElem[], message_id?: string): Promise<import("icqq").MessageRet>;
|
|
@@ -13,7 +13,7 @@ class FriendAction {
|
|
|
13
13
|
/**
|
|
14
14
|
* 发送私聊消息
|
|
15
15
|
* @param user_id {number} 用户id
|
|
16
|
-
* @param message {import('
|
|
16
|
+
* @param message {import('icqq').Sendable} 发送的消息
|
|
17
17
|
* @param message_id {string} 引用的消息ID
|
|
18
18
|
*/
|
|
19
19
|
async sendPrivateMsg(user_id, message, message_id) {
|
|
@@ -3,7 +3,7 @@ export declare class GroupAction {
|
|
|
3
3
|
/**
|
|
4
4
|
* 发送群聊消息
|
|
5
5
|
* @param group_id {number} 群id
|
|
6
|
-
* @param message {import('
|
|
6
|
+
* @param message {import('icqq').Sendable} 消息
|
|
7
7
|
* @param message_id {string} 引用的消息ID
|
|
8
8
|
*/
|
|
9
9
|
sendGroupMsg(this: V12, group_id: number, message: V12.SegmentElem[], message_id?: string): Promise<import("icqq").MessageRet>;
|
|
@@ -7,7 +7,7 @@ class GroupAction {
|
|
|
7
7
|
/**
|
|
8
8
|
* 发送群聊消息
|
|
9
9
|
* @param group_id {number} 群id
|
|
10
|
-
* @param message {import('
|
|
10
|
+
* @param message {import('icqq').Sendable} 消息
|
|
11
11
|
* @param message_id {string} 引用的消息ID
|
|
12
12
|
*/
|
|
13
13
|
async sendGroupMsg(group_id, message, message_id) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "onebots",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "基于
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "基于icqq的多例oneBot实现",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16"
|
|
7
7
|
},
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
24
|
"onebot",
|
|
25
|
-
"
|
|
25
|
+
"icqq",
|
|
26
26
|
"cq-http"
|
|
27
27
|
],
|
|
28
28
|
"author": "凉菜",
|