node-karin 0.12.0 → 0.12.2-5.pr.206.027f2f2
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/CHANGELOG.md +1029 -0
- package/default/comment/config.json +34 -0
- package/default/comment/friendDirect.json +10 -0
- package/default/comment/groupGuild.json +11 -0
- package/default/comment/server.json +17 -0
- package/default/config/adapter.json +28 -0
- package/default/config/config.json +47 -0
- package/default/config/groups.json +47 -0
- package/default/config/groups.yaml +70 -0
- package/default/config/pm2.json +16 -0
- package/default/config/privates.json +23 -0
- package/default/config/privates.yaml +31 -0
- package/default/config/redis.json +10 -0
- package/default/config/render.json +19 -0
- package/default/view/group.yaml +73 -0
- package/dist/index.d.ts +9869 -0
- package/dist/index.js +12643 -0
- package/dist/module/art-template.cjs +11 -0
- package/dist/module/art-template.d.ts +1 -0
- package/dist/module/axios.cjs +22 -0
- package/dist/module/axios.d.ts +2 -0
- package/dist/module/chalk.cjs +22 -0
- package/dist/module/chalk.d.ts +2 -0
- package/dist/module/chokidar.cjs +22 -0
- package/dist/module/chokidar.d.ts +2 -0
- package/dist/module/commander.cjs +35 -0
- package/dist/module/commander.d.ts +3 -0
- package/dist/module/commander.js +3 -0
- package/dist/module/dotenv.cjs +22 -0
- package/dist/module/dotenv.d.ts +2 -0
- package/dist/module/dotenv.js +2 -0
- package/dist/module/express.cjs +112 -0
- package/dist/module/express.d.ts +1 -0
- package/dist/module/express.js +1 -0
- package/dist/module/level.cjs +22 -0
- package/dist/module/level.d.ts +2 -0
- package/dist/module/lodash.cjs +11 -0
- package/dist/module/lodash.d.ts +1 -0
- package/dist/module/log4js.cjs +22 -0
- package/dist/module/log4js.d.ts +2 -0
- package/dist/module/moment.cjs +11 -0
- package/dist/module/moment.d.ts +1 -0
- package/dist/module/node-schedule.cjs +22 -0
- package/dist/module/node-schedule.d.ts +2 -0
- package/dist/module/redis.cjs +22 -0
- package/dist/module/redis.d.ts +2 -0
- package/dist/module/ws.cjs +28 -0
- package/dist/module/ws.d.ts +1 -0
- package/dist/module/ws.js +1 -0
- package/dist/module/yaml.cjs +22 -0
- package/dist/module/yaml.d.ts +2 -0
- package/dist/root.d.ts +40 -0
- package/dist/root.js +44 -0
- package/package.json +142 -128
- package/LICENSE +0 -674
- package/README.md +0 -56
- package/config/defSet/App.yaml +0 -42
- package/config/defSet/config.yaml +0 -65
- package/config/defSet/group.yaml +0 -56
- package/config/defSet/pm2.yaml +0 -21
- package/config/defSet/redis.yaml +0 -18
- package/config/defSet/server.yaml +0 -42
- package/config/view/group.yaml +0 -92
- package/lib/adapter/index.d.ts +0 -2
- package/lib/adapter/index.js +0 -2
- package/lib/adapter/input/index.d.ts +0 -78
- package/lib/adapter/input/index.js +0 -205
- package/lib/adapter/onebot/11/convert.d.ts +0 -12
- package/lib/adapter/onebot/11/convert.js +0 -167
- package/lib/adapter/onebot/11/event.d.ts +0 -25
- package/lib/adapter/onebot/11/event.js +0 -442
- package/lib/adapter/onebot/11/index.d.ts +0 -508
- package/lib/adapter/onebot/11/index.js +0 -1047
- package/lib/cli/index.d.ts +0 -92
- package/lib/cli/index.js +0 -307
- package/lib/cli/init.d.ts +0 -2
- package/lib/cli/init.js +0 -22
- package/lib/cli/karin.d.ts +0 -2
- package/lib/cli/karin.js +0 -16
- package/lib/cli/pkg.d.ts +0 -4
- package/lib/cli/pkg.js +0 -14
- package/lib/cli/start.d.ts +0 -1
- package/lib/cli/start.js +0 -8
- package/lib/core/index.d.ts +0 -10
- package/lib/core/index.js +0 -10
- package/lib/core/init/config.d.ts +0 -43
- package/lib/core/init/config.js +0 -201
- package/lib/core/init/dir.d.ts +0 -4
- package/lib/core/init/dir.js +0 -7
- package/lib/core/init/init.d.ts +0 -1
- package/lib/core/init/init.js +0 -47
- package/lib/core/karin/karin.d.ts +0 -198
- package/lib/core/karin/karin.js +0 -226
- package/lib/core/listener/listener.d.ts +0 -145
- package/lib/core/listener/listener.js +0 -235
- package/lib/core/plugin/base.d.ts +0 -156
- package/lib/core/plugin/base.js +0 -131
- package/lib/core/plugin/loader.d.ts +0 -141
- package/lib/core/plugin/loader.js +0 -618
- package/lib/core/process/process.d.ts +0 -18
- package/lib/core/process/process.js +0 -96
- package/lib/core/server/server.d.ts +0 -25
- package/lib/core/server/server.js +0 -295
- package/lib/db/index.d.ts +0 -2
- package/lib/db/index.js +0 -2
- package/lib/db/level/level.d.ts +0 -19
- package/lib/db/level/level.js +0 -36
- package/lib/db/redis/redis.d.ts +0 -2
- package/lib/db/redis/redis.js +0 -135
- package/lib/db/redis/redis_level.d.ts +0 -112
- package/lib/db/redis/redis_level.js +0 -281
- package/lib/event/handler/base.d.ts +0 -42
- package/lib/event/handler/base.js +0 -200
- package/lib/event/handler/message.d.ts +0 -29
- package/lib/event/handler/message.js +0 -307
- package/lib/event/handler/notice.d.ts +0 -18
- package/lib/event/handler/notice.js +0 -214
- package/lib/event/handler/request.d.ts +0 -18
- package/lib/event/handler/request.js +0 -115
- package/lib/event/handler/review.d.ts +0 -55
- package/lib/event/handler/review.js +0 -386
- package/lib/event/index.d.ts +0 -5
- package/lib/event/index.js +0 -5
- package/lib/index.d.ts +0 -8
- package/lib/index.js +0 -8
- package/lib/modules/art-template.d.ts +0 -1
- package/lib/modules/axios.d.ts +0 -2
- package/lib/modules/chalk.d.ts +0 -2
- package/lib/modules/chokidar.d.ts +0 -2
- package/lib/modules/commander.d.ts +0 -2
- package/lib/modules/commander.js +0 -2
- package/lib/modules/express.d.ts +0 -3
- package/lib/modules/express.js +0 -3
- package/lib/modules/level.d.ts +0 -2
- package/lib/modules/lodash.d.ts +0 -1
- package/lib/modules/log4js.d.ts +0 -2
- package/lib/modules/moment.d.ts +0 -1
- package/lib/modules/node-schedule.d.ts +0 -2
- package/lib/modules/redis.d.ts +0 -2
- package/lib/modules/ws.d.ts +0 -3
- package/lib/modules/ws.js +0 -3
- package/lib/modules/yaml.d.ts +0 -2
- package/lib/modules.d.ts +0 -15
- package/lib/modules.js +0 -15
- package/lib/render/app.d.ts +0 -56
- package/lib/render/app.js +0 -120
- package/lib/render/base.d.ts +0 -30
- package/lib/render/base.js +0 -69
- package/lib/render/client.d.ts +0 -41
- package/lib/render/client.js +0 -238
- package/lib/render/http.d.ts +0 -19
- package/lib/render/http.js +0 -50
- package/lib/render/index.d.ts +0 -6
- package/lib/render/index.js +0 -6
- package/lib/render/server.d.ts +0 -25
- package/lib/render/server.js +0 -101
- package/lib/render/wormhole.d.ts +0 -1
- package/lib/render/wormhole.js +0 -156
- package/lib/types/adapter/api.d.ts +0 -399
- package/lib/types/adapter/api.js +0 -1
- package/lib/types/adapter/base.d.ts +0 -560
- package/lib/types/adapter/base.js +0 -1
- package/lib/types/config/config.d.ts +0 -379
- package/lib/types/config/config.js +0 -1
- package/lib/types/element/element.d.ts +0 -565
- package/lib/types/element/element.js +0 -1
- package/lib/types/element/qqbot.d.ts +0 -123
- package/lib/types/element/qqbot.js +0 -1
- package/lib/types/event/contact.d.ts +0 -28
- package/lib/types/event/contact.js +0 -1
- package/lib/types/event/event.d.ts +0 -305
- package/lib/types/event/event.js +0 -1
- package/lib/types/event/index.d.ts +0 -12
- package/lib/types/event/index.js +0 -7
- package/lib/types/event/message.d.ts +0 -109
- package/lib/types/event/message.js +0 -74
- package/lib/types/event/notice.d.ts +0 -513
- package/lib/types/event/notice.js +0 -52
- package/lib/types/event/reply.d.ts +0 -50
- package/lib/types/event/reply.js +0 -1
- package/lib/types/event/request.d.ts +0 -126
- package/lib/types/event/request.js +0 -52
- package/lib/types/event/sender.d.ts +0 -44
- package/lib/types/event/sender.js +0 -1
- package/lib/types/index.d.ts +0 -13
- package/lib/types/index.js +0 -13
- package/lib/types/logger/logger.d.ts +0 -110
- package/lib/types/logger/logger.js +0 -1
- package/lib/types/onebot11/api.d.ts +0 -53
- package/lib/types/onebot11/api.js +0 -1
- package/lib/types/onebot11/event.d.ts +0 -619
- package/lib/types/onebot11/event.js +0 -2
- package/lib/types/onebot11/index.d.ts +0 -6
- package/lib/types/onebot11/index.js +0 -6
- package/lib/types/onebot11/params.d.ts +0 -609
- package/lib/types/onebot11/params.js +0 -1
- package/lib/types/onebot11/response.d.ts +0 -516
- package/lib/types/onebot11/response.js +0 -1
- package/lib/types/onebot11/segment.d.ts +0 -269
- package/lib/types/onebot11/segment.js +0 -1
- package/lib/types/onebot11/sender.d.ts +0 -59
- package/lib/types/onebot11/sender.js +0 -1
- package/lib/types/plugin/app.d.ts +0 -71
- package/lib/types/plugin/app.js +0 -1
- package/lib/types/plugin/plugin.d.ts +0 -473
- package/lib/types/plugin/plugin.js +0 -1
- package/lib/types/render/render.d.ts +0 -118
- package/lib/types/render/render.js +0 -1
- package/lib/types/type/global.d.ts +0 -25
- package/lib/types/type/global.js +0 -1
- package/lib/utils/common/common.d.ts +0 -236
- package/lib/utils/common/common.js +0 -708
- package/lib/utils/config/config.d.ts +0 -193
- package/lib/utils/config/config.js +0 -328
- package/lib/utils/config/updateVersion.d.ts +0 -33
- package/lib/utils/config/updateVersion.js +0 -145
- package/lib/utils/config/yamlEditor.d.ts +0 -101
- package/lib/utils/config/yamlEditor.js +0 -330
- package/lib/utils/core/handler.d.ts +0 -18
- package/lib/utils/core/handler.js +0 -46
- package/lib/utils/core/logger.d.ts +0 -3
- package/lib/utils/core/logger.js +0 -105
- package/lib/utils/core/segment.d.ts +0 -279
- package/lib/utils/core/segment.js +0 -451
- package/lib/utils/index.d.ts +0 -13
- package/lib/utils/index.js +0 -13
- package/lib/utils/tools/button.d.ts +0 -2
- package/lib/utils/tools/button.js +0 -27
- package/lib/utils/tools/exec.d.ts +0 -20
- package/lib/utils/tools/exec.js +0 -54
- package/lib/utils/tools/ffmpeg.d.ts +0 -12
- package/lib/utils/tools/ffmpeg.js +0 -25
- package/lib/utils/tools/restart.d.ts +0 -15
- package/lib/utils/tools/restart.js +0 -39
- package/lib/utils/tools/stop.d.ts +0 -7
- package/lib/utils/tools/stop.js +0 -13
- package/lib/utils/tools/update.d.ts +0 -67
- package/lib/utils/tools/update.js +0 -151
- /package/{config → default}/view/App.yaml +0 -0
- /package/{config → default}/view/config.yaml +0 -0
- /package/{config → default}/view/pm2.yaml +0 -0
- /package/{config → default}/view/redis.yaml +0 -0
- /package/{config → default}/view/server.yaml +0 -0
- /package/{lib/modules → dist/module}/art-template.js +0 -0
- /package/{lib/modules → dist/module}/axios.js +0 -0
- /package/{lib/modules → dist/module}/chalk.js +0 -0
- /package/{lib/modules → dist/module}/chokidar.js +0 -0
- /package/{lib/modules → dist/module}/level.js +0 -0
- /package/{lib/modules → dist/module}/lodash.js +0 -0
- /package/{lib/modules → dist/module}/log4js.js +0 -0
- /package/{lib/modules → dist/module}/moment.js +0 -0
- /package/{lib/modules → dist/module}/node-schedule.js +0 -0
- /package/{lib/modules → dist/module}/redis.js +0 -0
- /package/{lib/modules → dist/module}/yaml.js +0 -0
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* - OneBot11消息类型枚举
|
|
3
|
-
*/
|
|
4
|
-
export declare const enum OB11SegmentType {
|
|
5
|
-
Text = "text",
|
|
6
|
-
Face = "face",
|
|
7
|
-
Image = "image",
|
|
8
|
-
Record = "record",
|
|
9
|
-
Video = "video",
|
|
10
|
-
At = "at",
|
|
11
|
-
Rps = "rps",
|
|
12
|
-
Dice = "dice",
|
|
13
|
-
Shake = "shake",
|
|
14
|
-
Poke = "poke",
|
|
15
|
-
Anonymous = "anonymous",
|
|
16
|
-
Share = "share",
|
|
17
|
-
Contact = "contact",
|
|
18
|
-
Location = "location",
|
|
19
|
-
Music = "music",
|
|
20
|
-
MusicCustom = "music_custom",
|
|
21
|
-
Reply = "reply",
|
|
22
|
-
Forward = "forward",
|
|
23
|
-
Node = "node",
|
|
24
|
-
NodeCustom = "node_custom",
|
|
25
|
-
Xml = "xml",
|
|
26
|
-
Json = "json",
|
|
27
|
-
File = "file"
|
|
28
|
-
}
|
|
29
|
-
export interface Segment {
|
|
30
|
-
type: OB11SegmentType;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* - 纯文本
|
|
34
|
-
*/
|
|
35
|
-
export interface TextSegment extends Segment {
|
|
36
|
-
type: OB11SegmentType.Text;
|
|
37
|
-
data: {
|
|
38
|
-
text: string;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* - QQ表情
|
|
43
|
-
*/
|
|
44
|
-
export interface FaceSegment extends Segment {
|
|
45
|
-
type: OB11SegmentType.Face;
|
|
46
|
-
data: {
|
|
47
|
-
id: string;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* - 图片消息段
|
|
52
|
-
*/
|
|
53
|
-
export interface ImageSegment extends Segment {
|
|
54
|
-
type: OB11SegmentType.Image;
|
|
55
|
-
data: {
|
|
56
|
-
file: string;
|
|
57
|
-
type?: 'flash';
|
|
58
|
-
url?: string;
|
|
59
|
-
cache?: 0 | 1;
|
|
60
|
-
proxy?: 0 | 1;
|
|
61
|
-
timeout?: number;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* - 语音消息段
|
|
66
|
-
*/
|
|
67
|
-
export interface RecordSegment extends Segment {
|
|
68
|
-
type: OB11SegmentType.Record;
|
|
69
|
-
data: {
|
|
70
|
-
file: string;
|
|
71
|
-
magic?: 0 | 1;
|
|
72
|
-
url?: string;
|
|
73
|
-
cache?: 0 | 1;
|
|
74
|
-
proxy?: 0 | 1;
|
|
75
|
-
timeout?: number;
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* - 短视频消息段
|
|
80
|
-
*/
|
|
81
|
-
export interface VideoSegment extends Segment {
|
|
82
|
-
type: OB11SegmentType.Video;
|
|
83
|
-
data: {
|
|
84
|
-
file: string;
|
|
85
|
-
url?: string;
|
|
86
|
-
cache?: 0 | 1;
|
|
87
|
-
proxy?: 0 | 1;
|
|
88
|
-
timeout?: number;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* - @某人消息段
|
|
93
|
-
*/
|
|
94
|
-
export interface AtSegment extends Segment {
|
|
95
|
-
type: OB11SegmentType.At;
|
|
96
|
-
data: {
|
|
97
|
-
qq: string | 'all';
|
|
98
|
-
name?: string;
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* - 猜拳魔法表情消息段
|
|
103
|
-
*/
|
|
104
|
-
export interface RpsSegment extends Segment {
|
|
105
|
-
type: OB11SegmentType.Rps;
|
|
106
|
-
data: {};
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* - 掷骰子魔法表情消息段
|
|
110
|
-
*/
|
|
111
|
-
export interface DiceSegment extends Segment {
|
|
112
|
-
type: OB11SegmentType.Dice;
|
|
113
|
-
data: {};
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* - 窗口抖动(戳一戳)消息段
|
|
117
|
-
*/
|
|
118
|
-
export interface ShakeSegment extends Segment {
|
|
119
|
-
type: OB11SegmentType.Shake;
|
|
120
|
-
data: {};
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* - 戳一戳消息段
|
|
124
|
-
*/
|
|
125
|
-
export interface PokeSegment extends Segment {
|
|
126
|
-
type: OB11SegmentType.Poke;
|
|
127
|
-
data: {
|
|
128
|
-
type: string;
|
|
129
|
-
id: string;
|
|
130
|
-
name?: string;
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* - 匿名发消息消息段
|
|
135
|
-
*/
|
|
136
|
-
export interface AnonymousSegment extends Segment {
|
|
137
|
-
type: OB11SegmentType.Anonymous;
|
|
138
|
-
data: {
|
|
139
|
-
ignore?: 0 | 1;
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* - 链接分享消息段
|
|
144
|
-
*/
|
|
145
|
-
export interface ShareSegment extends Segment {
|
|
146
|
-
type: OB11SegmentType.Share;
|
|
147
|
-
data: {
|
|
148
|
-
url: string;
|
|
149
|
-
title: string;
|
|
150
|
-
content?: string;
|
|
151
|
-
image?: string;
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* - 推荐好友/群消息段
|
|
156
|
-
*/
|
|
157
|
-
export interface ContactSegment extends Segment {
|
|
158
|
-
type: OB11SegmentType.Contact;
|
|
159
|
-
data: {
|
|
160
|
-
type: 'qq' | 'group';
|
|
161
|
-
id: string;
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* - 位置消息段
|
|
166
|
-
*/
|
|
167
|
-
export interface LocationSegment extends Segment {
|
|
168
|
-
type: OB11SegmentType.Location;
|
|
169
|
-
data: {
|
|
170
|
-
lat: string;
|
|
171
|
-
lon: string;
|
|
172
|
-
title?: string;
|
|
173
|
-
content?: string;
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* - 音乐分享消息段
|
|
178
|
-
*/
|
|
179
|
-
export interface MusicSegment extends Segment {
|
|
180
|
-
type: OB11SegmentType.Music;
|
|
181
|
-
data: {
|
|
182
|
-
type: 'qq' | '163' | 'xm';
|
|
183
|
-
id: string;
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* - 音乐自定义分享消息段
|
|
188
|
-
*/
|
|
189
|
-
export interface CustomMusicSegment extends Segment {
|
|
190
|
-
type: OB11SegmentType.MusicCustom;
|
|
191
|
-
data: {
|
|
192
|
-
type: 'custom';
|
|
193
|
-
url: string;
|
|
194
|
-
audio: string;
|
|
195
|
-
title: string;
|
|
196
|
-
content?: string;
|
|
197
|
-
image?: string;
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* - 回复消息段
|
|
202
|
-
*/
|
|
203
|
-
export interface ReplySegment extends Segment {
|
|
204
|
-
type: OB11SegmentType.Reply;
|
|
205
|
-
data: {
|
|
206
|
-
id: string;
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
export interface FileSegment extends Segment {
|
|
210
|
-
type: OB11SegmentType.File;
|
|
211
|
-
data: {
|
|
212
|
-
file: string;
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* - 合并转发消息段
|
|
217
|
-
*/
|
|
218
|
-
export interface ForwardSegment extends Segment {
|
|
219
|
-
type: OB11SegmentType.Forward;
|
|
220
|
-
data: {
|
|
221
|
-
id: string;
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* - 合并转发节点消息段
|
|
226
|
-
*/
|
|
227
|
-
export interface NodeSegment extends Segment {
|
|
228
|
-
type: OB11SegmentType.Node;
|
|
229
|
-
data: {
|
|
230
|
-
id: string;
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* - XML消息段
|
|
235
|
-
*/
|
|
236
|
-
export interface XmlSegment extends Segment {
|
|
237
|
-
type: OB11SegmentType.Xml;
|
|
238
|
-
data: {
|
|
239
|
-
data: string;
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* - JSON消息段
|
|
244
|
-
*/
|
|
245
|
-
export interface JsonSegment extends Segment {
|
|
246
|
-
type: OB11SegmentType.Json;
|
|
247
|
-
data: {
|
|
248
|
-
data: string;
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* - OneBot11消息段
|
|
253
|
-
*/
|
|
254
|
-
export type OB11SegmentBase = TextSegment | FaceSegment | ImageSegment | RecordSegment | VideoSegment | AtSegment | RpsSegment | DiceSegment | ShakeSegment | PokeSegment | AnonymousSegment | ShareSegment | ContactSegment | LocationSegment | MusicSegment | CustomMusicSegment | ReplySegment | ForwardSegment | NodeSegment | XmlSegment | JsonSegment;
|
|
255
|
-
/**
|
|
256
|
-
* - 合并转发自定义节点消息段
|
|
257
|
-
*/
|
|
258
|
-
export interface CustomNodeSegment extends Segment {
|
|
259
|
-
type: OB11SegmentType.NodeCustom;
|
|
260
|
-
data: {
|
|
261
|
-
user_id: string;
|
|
262
|
-
nickname: string;
|
|
263
|
-
content: OB11SegmentBase[];
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* - OneBot11消息段
|
|
268
|
-
*/
|
|
269
|
-
export type OB11Segment = OB11SegmentBase | CustomNodeSegment;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export type OB11Sex = 'male' | 'female' | 'unknown';
|
|
2
|
-
export type OB11Role = 'owner' | 'admin' | 'member' | '';
|
|
3
|
-
export interface PrivateSender {
|
|
4
|
-
/**
|
|
5
|
-
* - 发送者 QQ 号
|
|
6
|
-
*/
|
|
7
|
-
user_id: string;
|
|
8
|
-
/**
|
|
9
|
-
* - 昵称 不存在则为空字符串
|
|
10
|
-
*/
|
|
11
|
-
nickname: string;
|
|
12
|
-
/**
|
|
13
|
-
* - 性别
|
|
14
|
-
*/
|
|
15
|
-
sex?: OB11Sex;
|
|
16
|
-
/**
|
|
17
|
-
* - 年龄
|
|
18
|
-
*/
|
|
19
|
-
age?: number;
|
|
20
|
-
}
|
|
21
|
-
export interface GroupSender {
|
|
22
|
-
/**
|
|
23
|
-
* - 发送者 QQ 号
|
|
24
|
-
*/
|
|
25
|
-
user_id: string;
|
|
26
|
-
/**
|
|
27
|
-
* - 昵称 不存在则为空字符串
|
|
28
|
-
*/
|
|
29
|
-
nickname: string;
|
|
30
|
-
/**
|
|
31
|
-
* - 性别
|
|
32
|
-
*/
|
|
33
|
-
sex?: OB11Sex;
|
|
34
|
-
/**
|
|
35
|
-
* - 年龄
|
|
36
|
-
*/
|
|
37
|
-
age?: number;
|
|
38
|
-
/**
|
|
39
|
-
* - 群名片/备注
|
|
40
|
-
*/
|
|
41
|
-
card?: string;
|
|
42
|
-
/**
|
|
43
|
-
* - 地区
|
|
44
|
-
*/
|
|
45
|
-
area?: string;
|
|
46
|
-
/**
|
|
47
|
-
* - 成员等级
|
|
48
|
-
*/
|
|
49
|
-
level?: string;
|
|
50
|
-
/**
|
|
51
|
-
* - 角色 不存在则为空字符串
|
|
52
|
-
*/
|
|
53
|
-
role: OB11Role;
|
|
54
|
-
/**
|
|
55
|
-
* - 专属头衔
|
|
56
|
-
*/
|
|
57
|
-
title?: string;
|
|
58
|
-
}
|
|
59
|
-
export type ob11Sender = PrivateSender | GroupSender;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { MiddlewareType } from '../../core/karin/karin.js';
|
|
2
|
-
import { AllMessageSubType, AllNoticeSubType, AllRequestSubType, KarinMessageType, KarinNoticeType, KarinRequestType, NewMessagePlugin, Permission } from '../../types/index.js';
|
|
3
|
-
export declare const enum AppType {
|
|
4
|
-
Command = "command",
|
|
5
|
-
Task = "task",
|
|
6
|
-
Handler = "handler",
|
|
7
|
-
Button = "button",
|
|
8
|
-
Accept = "accept",
|
|
9
|
-
Use = "use"
|
|
10
|
-
}
|
|
11
|
-
interface AppInfo {
|
|
12
|
-
/** 实现方法 */
|
|
13
|
-
fn: Function;
|
|
14
|
-
/** 插件名称 */
|
|
15
|
-
name: string;
|
|
16
|
-
/** 插件类型 */
|
|
17
|
-
type: `${AppType}`;
|
|
18
|
-
/** 插件优先级 */
|
|
19
|
-
rank: number;
|
|
20
|
-
/** 执行方法打印日志函数 */
|
|
21
|
-
log: Function;
|
|
22
|
-
}
|
|
23
|
-
/** command规则集类型 */
|
|
24
|
-
export interface CommandInfo extends AppInfo {
|
|
25
|
-
fn: (e: KarinMessageType) => Promise<boolean>;
|
|
26
|
-
/** 插件执行方法名称 */
|
|
27
|
-
fnname: string;
|
|
28
|
-
type: `${AppType.Command}`;
|
|
29
|
-
/** 监听事件 */
|
|
30
|
-
event: `${AllMessageSubType}`;
|
|
31
|
-
/** 正则 */
|
|
32
|
-
reg: RegExp;
|
|
33
|
-
/** 权限 */
|
|
34
|
-
perm: `${Permission}`;
|
|
35
|
-
/** class */
|
|
36
|
-
data: NewMessagePlugin | '';
|
|
37
|
-
}
|
|
38
|
-
/** task规则集类型 */
|
|
39
|
-
export interface TaskInfo extends Omit<AppInfo, 'rank'> {
|
|
40
|
-
type: `${AppType.Task}`;
|
|
41
|
-
/** 任务名称 */
|
|
42
|
-
fnname: string;
|
|
43
|
-
/** cron表达式 */
|
|
44
|
-
cron: string;
|
|
45
|
-
}
|
|
46
|
-
/** handler规则集类型 */
|
|
47
|
-
export interface HandlerInfo extends Omit<AppInfo, 'log'> {
|
|
48
|
-
type: `${AppType.Handler}`;
|
|
49
|
-
/** 入口秘钥 */
|
|
50
|
-
key: string;
|
|
51
|
-
}
|
|
52
|
-
/** button规则集类型 */
|
|
53
|
-
export interface ButtonInfo extends AppInfo {
|
|
54
|
-
type: `${AppType.Button}`;
|
|
55
|
-
/** 正则 */
|
|
56
|
-
reg: RegExp;
|
|
57
|
-
}
|
|
58
|
-
/** accept规则集类型 */
|
|
59
|
-
export interface AcceptInfo extends AppInfo {
|
|
60
|
-
fn: (e: KarinNoticeType | KarinRequestType) => Promise<boolean>;
|
|
61
|
-
type: `${AppType.Accept}`;
|
|
62
|
-
/** 监听事件 */
|
|
63
|
-
event: `${AllNoticeSubType}` | `${AllRequestSubType}`;
|
|
64
|
-
}
|
|
65
|
-
/** use规则集类型 */
|
|
66
|
-
export interface UseInfo extends Omit<AppInfo, 'log'> {
|
|
67
|
-
type: `${AppType.Use}`;
|
|
68
|
-
/** 中间件类型key */
|
|
69
|
-
key: `${MiddlewareType}`;
|
|
70
|
-
}
|
|
71
|
-
export {};
|
package/lib/types/plugin/app.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|