node-karin 0.5.0 → 0.6.1

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.
@@ -0,0 +1,4 @@
1
+ export * from './input/index.js';
2
+ export * from './kritor/grpc.js';
3
+ export * from './kritor/index.js';
4
+ export * from './onebot/onebot11.js';
@@ -0,0 +1,4 @@
1
+ export * from './input/index.js'
2
+ export * from './kritor/grpc.js'
3
+ export * from './kritor/index.js'
4
+ export * from './onebot/onebot11.js'
@@ -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
- SetGroupApplyResultRequest(): Promise<any>;
36
+ SetGroupApplyResult(): Promise<any>;
37
37
  SetInvitedJoinGroupResult(): Promise<any>;
38
- ReactMessageWithEmojiRequest(): Promise<any>;
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(),
@@ -135,7 +136,7 @@ export class AdapterInput {
135
136
  text.push(`[未知消息类型:${JSON.stringify(v)}]`);
136
137
  }
137
138
  }
138
- this.logger('info', text.join(''));
139
+ this.logger('info', `${logger.green('Send private input: ')}${text.join('')}`);
139
140
  return { message_id: 'input' };
140
141
  }
141
142
  getAvatarUrl() {
@@ -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 SetGroupApplyResultRequest() { throw new Error('Method not implemented.'); }
156
+ async SetGroupApplyResult() { throw new Error('Method not implemented.'); }
156
157
  async SetInvitedJoinGroupResult() { throw new Error('Method not implemented.'); }
157
- async ReactMessageWithEmojiRequest() { throw new Error('Method not implemented.'); }
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;