node-karin 0.5.1 → 0.6.2
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/adapter/index.d.ts +4 -0
- package/lib/adapter/index.js +4 -0
- package/lib/adapter/input/index.d.ts +2 -2
- package/lib/adapter/input/index.js +3 -2
- package/lib/adapter/kritor/grpc.d.ts +33 -0
- package/lib/adapter/kritor/grpc.js +981 -0
- package/lib/adapter/kritor/index.d.ts +391 -0
- package/lib/adapter/kritor/index.js +1164 -0
- package/lib/adapter/onebot/onebot11.d.ts +7 -9
- package/lib/adapter/onebot/onebot11.js +22 -23
- package/lib/core/dir.d.ts +3 -0
- package/lib/core/dir.js +3 -0
- package/lib/core/plugin.loader.js +13 -1
- package/lib/core/server.js +2 -2
- package/lib/event/index.d.ts +2 -0
- package/lib/event/index.js +2 -2
- package/lib/event/message.d.ts +5 -1
- package/lib/event/message.js +2 -2
- package/lib/event/notice.handler.js +8 -8
- package/lib/event/request.handler.js +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +1 -0
- package/lib/modules.d.ts +2 -1
- package/lib/modules.js +2 -1
- package/lib/tools/init.js +8 -10
- package/lib/types/adapter.d.ts +3 -4
- package/lib/types/element.d.ts +3 -1
- package/lib/types/event.d.ts +17 -21
- package/lib/utils/common.d.ts +4 -0
- package/lib/utils/common.js +12 -0
- package/lib/utils/config.d.ts +3 -2
- package/lib/utils/config.js +11 -6
- package/lib/utils/segment.d.ts +3 -2
- package/lib/utils/segment.js +4 -2
- package/modules.d.ts +2 -1
- package/modules.js +2 -1
- package/package.json +3 -5
|
@@ -33,9 +33,9 @@ export declare class AdapterInput implements KarinAdapter {
|
|
|
33
33
|
SetEssenceMessage(): Promise<any>;
|
|
34
34
|
DeleteEssenceMessage(): Promise<any>;
|
|
35
35
|
SetFriendApplyResult(): Promise<any>;
|
|
36
|
-
|
|
36
|
+
SetGroupApplyResult(): Promise<any>;
|
|
37
37
|
SetInvitedJoinGroupResult(): Promise<any>;
|
|
38
|
-
|
|
38
|
+
ReactMessageWithEmoji(): Promise<any>;
|
|
39
39
|
UploadPrivateFile(): Promise<any>;
|
|
40
40
|
UploadGroupFile(): Promise<any>;
|
|
41
41
|
UploadForwardMessage(): Promise<any>;
|
|
@@ -61,6 +61,7 @@ export class AdapterInput {
|
|
|
61
61
|
async #input(elements) {
|
|
62
62
|
const message = {
|
|
63
63
|
event: 'message',
|
|
64
|
+
event_id: `input.${Date.now()}`,
|
|
64
65
|
self_id: 'input',
|
|
65
66
|
user_id: 'input',
|
|
66
67
|
time: Date.now(),
|
|
@@ -152,9 +153,9 @@ export class AdapterInput {
|
|
|
152
153
|
async SetEssenceMessage() { throw new Error('Method not implemented.'); }
|
|
153
154
|
async DeleteEssenceMessage() { throw new Error('Method not implemented.'); }
|
|
154
155
|
async SetFriendApplyResult() { throw new Error('Method not implemented.'); }
|
|
155
|
-
async
|
|
156
|
+
async SetGroupApplyResult() { throw new Error('Method not implemented.'); }
|
|
156
157
|
async SetInvitedJoinGroupResult() { throw new Error('Method not implemented.'); }
|
|
157
|
-
async
|
|
158
|
+
async ReactMessageWithEmoji() { throw new Error('Method not implemented.'); }
|
|
158
159
|
async UploadPrivateFile() { throw new Error('Method not implemented.'); }
|
|
159
160
|
async UploadGroupFile() { throw new Error('Method not implemented.'); }
|
|
160
161
|
async UploadForwardMessage() { throw new Error('Method not implemented.'); }
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { KarinElement } from '../../types/index.js';
|
|
2
|
+
import { kritor } from 'kritor-proto';
|
|
3
|
+
export declare class KritorGrpc {
|
|
4
|
+
#private;
|
|
5
|
+
/**
|
|
6
|
+
* - proto 文件路径
|
|
7
|
+
*/
|
|
8
|
+
dir: string;
|
|
9
|
+
BotMap: Map<string, any>;
|
|
10
|
+
constructor();
|
|
11
|
+
/**
|
|
12
|
+
* 获取 proto 文件
|
|
13
|
+
* @param filename 文件名
|
|
14
|
+
*/
|
|
15
|
+
getProto(filename: string): any;
|
|
16
|
+
/**
|
|
17
|
+
* 初始化 gRPC 服务器
|
|
18
|
+
*/
|
|
19
|
+
init(): void;
|
|
20
|
+
/**
|
|
21
|
+
* scene contact转换器
|
|
22
|
+
*/
|
|
23
|
+
KarinSceneContact(contact: kritor.common.IContact, sender: kritor.common.ISender): {
|
|
24
|
+
scene: string;
|
|
25
|
+
role: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* kritor 转 karin
|
|
29
|
+
* @param data 消息数据
|
|
30
|
+
*/
|
|
31
|
+
AdapterConvertKarin(data: Array<kritor.common.Element>): Array<KarinElement>;
|
|
32
|
+
}
|
|
33
|
+
export declare const grpcServer: KritorGrpc;
|