node-karin 0.0.3 → 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/LICENSE +674 -674
- package/README.md +57 -57
- package/config/defSet/App.yaml +37 -37
- package/config/defSet/config.yaml +43 -43
- package/config/defSet/group.yaml +18 -18
- package/config/defSet/pm2.yaml +21 -21
- package/config/defSet/server.yaml +42 -42
- package/config/view/App.yaml +74 -74
- package/config/view/config.yaml +100 -100
- package/config/view/group.yaml +62 -62
- package/config/view/pm2.yaml +41 -41
- package/config/view/redis.yaml +25 -25
- package/config/view/server.yaml +93 -93
- package/lib/adapter/onebot/onebot11.d.ts +430 -430
- package/lib/adapter/onebot/onebot11.js +1265 -1302
- package/lib/core/init.js +4 -4
- package/lib/core/karin.d.ts +72 -72
- package/lib/core/karin.js +51 -51
- package/lib/core/listener.d.ts +121 -121
- package/lib/core/listener.js +178 -178
- package/lib/core/plugin.app.d.ts +15 -15
- package/lib/core/plugin.app.js +18 -18
- package/lib/core/plugin.d.ts +182 -182
- package/lib/core/plugin.js +132 -132
- package/lib/core/plugin.loader.d.ts +149 -149
- package/lib/core/plugin.loader.js +451 -451
- package/lib/core/server.d.ts +26 -26
- package/lib/core/server.js +209 -209
- package/lib/db/level.d.ts +20 -20
- package/lib/db/level.js +36 -36
- package/lib/db/redis.d.ts +41 -41
- package/lib/db/redis.js +131 -131
- package/lib/db/redis_level.d.ts +113 -113
- package/lib/db/redis_level.js +274 -274
- package/lib/event/event.d.ts +138 -138
- package/lib/event/event.handler.d.ts +29 -29
- package/lib/event/event.handler.js +138 -138
- package/lib/event/event.js +120 -120
- package/lib/event/message.d.ts +102 -102
- package/lib/event/message.handler.d.ts +25 -25
- package/lib/event/message.handler.js +237 -237
- package/lib/event/message.js +69 -69
- package/lib/event/notice.d.ts +49 -49
- package/lib/event/notice.js +14 -14
- package/lib/event/request.d.ts +49 -49
- package/lib/event/request.js +14 -14
- package/lib/event/review.handler.d.ts +54 -54
- package/lib/event/review.handler.js +374 -374
- package/lib/index.d.ts +23 -23
- package/lib/index.js +39 -40
- package/lib/renderer/app.d.ts +53 -53
- package/lib/renderer/app.js +88 -88
- package/lib/renderer/base.d.ts +30 -30
- package/lib/renderer/base.js +68 -68
- package/lib/renderer/client.d.ts +30 -30
- package/lib/renderer/client.js +155 -155
- package/lib/renderer/http.d.ts +19 -19
- package/lib/renderer/http.js +50 -50
- package/lib/renderer/server.d.ts +42 -42
- package/lib/renderer/server.js +110 -110
- package/lib/renderer/wormhole.d.ts +1 -1
- package/lib/renderer/wormhole.js +154 -154
- package/lib/types/adapter.d.ts +575 -575
- package/lib/types/adapter.js +1 -1
- package/lib/types/config.d.ts +327 -327
- package/lib/types/config.js +1 -1
- package/lib/types/element.d.ts +576 -576
- package/lib/types/element.js +1 -1
- package/lib/types/index.d.ts +8 -8
- package/lib/types/index.js +8 -8
- package/lib/types/logger.d.ts +109 -109
- package/lib/types/logger.js +1 -1
- package/lib/types/onebots11.d.ts +1371 -1371
- package/lib/types/onebots11.js +1 -1
- package/lib/types/plugin.d.ts +282 -282
- package/lib/types/plugin.js +1 -1
- package/lib/types/render.d.ts +111 -111
- package/lib/types/render.js +1 -1
- package/lib/types/reply.d.ts +40 -40
- package/lib/types/reply.js +1 -1
- package/lib/types/types.d.ts +898 -898
- package/lib/types/types.js +1 -1
- package/lib/utils/YamlEditor.d.ts +62 -62
- package/lib/utils/YamlEditor.js +197 -197
- package/lib/utils/button.d.ts +49 -49
- package/lib/utils/button.js +75 -75
- package/lib/utils/common.d.ts +123 -123
- package/lib/utils/common.js +396 -396
- package/lib/utils/config.d.ts +72 -72
- package/lib/utils/config.js +254 -254
- package/lib/utils/exec.d.ts +22 -22
- package/lib/utils/exec.js +36 -36
- package/lib/utils/ffmpeg.d.ts +12 -12
- package/lib/utils/ffmpeg.js +25 -25
- package/lib/utils/handler.d.ts +76 -76
- package/lib/utils/handler.js +98 -98
- package/lib/utils/logger.d.ts +3 -3
- package/lib/utils/logger.js +104 -104
- package/lib/utils/segment.d.ts +276 -276
- package/lib/utils/segment.js +420 -420
- package/lib/utils/update.d.ts +69 -69
- package/lib/utils/update.js +145 -145
- package/lib/utils/updateVersion.d.ts +33 -33
- package/lib/utils/updateVersion.js +140 -140
- package/package.json +92 -91
package/lib/utils/button.js
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import lodash from 'lodash'
|
|
2
|
-
import logger from './logger.js'
|
|
3
|
-
export default new (class Button {
|
|
4
|
-
Apps
|
|
5
|
-
constructor () {
|
|
6
|
-
this.Apps = []
|
|
1
|
+
import lodash from 'lodash'
|
|
2
|
+
import logger from './logger.js'
|
|
3
|
+
export default new (class Button {
|
|
4
|
+
Apps
|
|
5
|
+
constructor () {
|
|
6
|
+
this.Apps = []
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
add ({ name, dir, App, Class }) {
|
|
10
|
-
const rule = []
|
|
11
|
-
/** 创建正则表达式 */
|
|
12
|
-
for (const v of Class.button) {
|
|
13
|
-
try {
|
|
14
|
-
const { reg, fnc } = v
|
|
15
|
-
rule.push({ reg: new RegExp(reg), fnc })
|
|
16
|
-
} catch (error) {
|
|
17
|
-
logger.error(error)
|
|
18
|
-
continue
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
this.Apps.push({
|
|
22
|
-
App,
|
|
23
|
-
name: Class.name,
|
|
24
|
-
priority: Class.priority,
|
|
25
|
-
file: { name, dir },
|
|
26
|
-
rule,
|
|
27
|
-
})
|
|
8
|
+
|
|
9
|
+
add ({ name, dir, App, Class }) {
|
|
10
|
+
const rule = []
|
|
11
|
+
/** 创建正则表达式 */
|
|
12
|
+
for (const v of Class.button) {
|
|
13
|
+
try {
|
|
14
|
+
const { reg, fnc } = v
|
|
15
|
+
rule.push({ reg: new RegExp(reg), fnc })
|
|
16
|
+
} catch (error) {
|
|
17
|
+
logger.error(error)
|
|
18
|
+
continue
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
this.Apps.push({
|
|
22
|
+
App,
|
|
23
|
+
name: Class.name,
|
|
24
|
+
priority: Class.priority,
|
|
25
|
+
file: { name, dir },
|
|
26
|
+
rule,
|
|
27
|
+
})
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 卸载按钮
|
|
32
|
-
* @param {string} dir 插件目录
|
|
33
|
-
* @param {string} name 插件文件名称
|
|
34
|
-
*/
|
|
35
|
-
del (dir, name) {
|
|
36
|
-
/** 未传入name则删除所有 */
|
|
37
|
-
if (!name) {
|
|
38
|
-
this.Apps = this.Apps.filter(v => v.file.dir !== dir)
|
|
39
|
-
} else {
|
|
40
|
-
/** 传入name则删除指定 */
|
|
41
|
-
this.Apps = this.Apps.filter(v => v.file.dir !== dir || v.file.name !== name)
|
|
42
|
-
}
|
|
43
|
-
/** 排序 */
|
|
44
|
-
this.Apps = lodash.orderBy(this.Apps, ['priority'], ['asc'])
|
|
45
|
-
return this.Apps
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 卸载按钮
|
|
32
|
+
* @param {string} dir 插件目录
|
|
33
|
+
* @param {string} name 插件文件名称
|
|
34
|
+
*/
|
|
35
|
+
del (dir, name) {
|
|
36
|
+
/** 未传入name则删除所有 */
|
|
37
|
+
if (!name) {
|
|
38
|
+
this.Apps = this.Apps.filter(v => v.file.dir !== dir)
|
|
39
|
+
} else {
|
|
40
|
+
/** 传入name则删除指定 */
|
|
41
|
+
this.Apps = this.Apps.filter(v => v.file.dir !== dir || v.file.name !== name)
|
|
42
|
+
}
|
|
43
|
+
/** 排序 */
|
|
44
|
+
this.Apps = lodash.orderBy(this.Apps, ['priority'], ['asc'])
|
|
45
|
+
return this.Apps
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
update ({ dir, name, App, Class }) {
|
|
49
|
-
this.del(dir, name)
|
|
50
|
-
this.add({ name, dir, App, Class })
|
|
47
|
+
|
|
48
|
+
update ({ dir, name, App, Class }) {
|
|
49
|
+
this.del(dir, name)
|
|
50
|
+
this.add({ name, dir, App, Class })
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
async get (e) {
|
|
54
|
-
const button = []
|
|
55
|
-
for (const app of this.Apps) {
|
|
56
|
-
for (const v of app.rule) {
|
|
57
|
-
/** 这里的lastIndex是为了防止正则无法从头开始匹配 */
|
|
58
|
-
v.reg.lastIndex = 0
|
|
59
|
-
if (v.reg.test(e.msg)) {
|
|
60
|
-
try {
|
|
61
|
-
const App = new app.App()
|
|
62
|
-
App.e = e
|
|
63
|
-
const res = await App[v.fnc](e)
|
|
64
|
-
if (!res) { continue }
|
|
65
|
-
/** 是否继续循环 */
|
|
66
|
-
const cycle = res.cycle ?? true
|
|
67
|
-
delete res.cycle
|
|
68
|
-
button.push(res)
|
|
69
|
-
if (cycle !== false) { return button }
|
|
70
|
-
} catch (error) {
|
|
71
|
-
logger.error(error)
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
/** 理论上不会走到这里,但是还是要稳一手,不排除有所有插件都false... */
|
|
77
|
-
return button
|
|
78
|
-
}
|
|
79
|
-
})()
|
|
52
|
+
|
|
53
|
+
async get (e) {
|
|
54
|
+
const button = []
|
|
55
|
+
for (const app of this.Apps) {
|
|
56
|
+
for (const v of app.rule) {
|
|
57
|
+
/** 这里的lastIndex是为了防止正则无法从头开始匹配 */
|
|
58
|
+
v.reg.lastIndex = 0
|
|
59
|
+
if (v.reg.test(e.msg)) {
|
|
60
|
+
try {
|
|
61
|
+
const App = new app.App()
|
|
62
|
+
App.e = e
|
|
63
|
+
const res = await App[v.fnc](e)
|
|
64
|
+
if (!res) { continue }
|
|
65
|
+
/** 是否继续循环 */
|
|
66
|
+
const cycle = res.cycle ?? true
|
|
67
|
+
delete res.cycle
|
|
68
|
+
button.push(res)
|
|
69
|
+
if (cycle !== false) { return button }
|
|
70
|
+
} catch (error) {
|
|
71
|
+
logger.error(error)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/** 理论上不会走到这里,但是还是要稳一手,不排除有所有插件都false... */
|
|
77
|
+
return button
|
|
78
|
+
}
|
|
79
|
+
})()
|
package/lib/utils/common.d.ts
CHANGED
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import { AxiosRequestConfig } from 'axios';
|
|
4
|
-
import { Readable } from 'stream';
|
|
5
|
-
import { KarinElement, KarinNodeElement } from '../types/element.js';
|
|
6
|
-
import { dirName } from '../types/plugin.js';
|
|
7
|
-
/**
|
|
8
|
-
* 常用方法
|
|
9
|
-
*/
|
|
10
|
-
declare const _default: {
|
|
11
|
-
streamPipeline: (stream1: Readable, stream2: fs.WriteStream) => Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* 休眠函数
|
|
14
|
-
* @param ms 毫秒
|
|
15
|
-
*/
|
|
16
|
-
sleep(ms: number): Promise<unknown>;
|
|
17
|
-
/**
|
|
18
|
-
* 下载保存文件
|
|
19
|
-
* @param fileUrl 下载地址
|
|
20
|
-
* @param savePath 保存路径
|
|
21
|
-
* @param param axios参数
|
|
22
|
-
*/
|
|
23
|
-
downFile(fileUrl: string, savePath: string, param?: AxiosRequestConfig): Promise<boolean>;
|
|
24
|
-
/**
|
|
25
|
-
* 递归创建目录
|
|
26
|
-
* @param dirname - 要创建的文件夹路径
|
|
27
|
-
*/
|
|
28
|
-
mkdir(dirname: string): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* 标准化文件路径
|
|
31
|
-
* @param file - 相对路径
|
|
32
|
-
* @param isDir - 返回绝对路径
|
|
33
|
-
* @param isFile - 添加file://前缀
|
|
34
|
-
* @returns 标准化后的路径
|
|
35
|
-
*/
|
|
36
|
-
absPath(file: string, isDir?: boolean, isFile?: boolean): string;
|
|
37
|
-
/**
|
|
38
|
-
* 判断是否为文件夹
|
|
39
|
-
* @param path - 路径
|
|
40
|
-
* @returns 返回true为文件夹
|
|
41
|
-
*/
|
|
42
|
-
isDir(path: string): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* 判断是否为插件包
|
|
45
|
-
* @param path - 路径
|
|
46
|
-
* @returns 返回true为插件包
|
|
47
|
-
*/
|
|
48
|
-
isPlugin(path: string): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* 判断路径是否存在
|
|
51
|
-
* @param path - 路径
|
|
52
|
-
* @returns 返回true为存在
|
|
53
|
-
*/
|
|
54
|
-
exists(path: string): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* 根据文件后缀名从指定路径下读取符合要求的文件
|
|
57
|
-
* @param path - 路径
|
|
58
|
-
* @param ext - 后缀名、或后缀名列表
|
|
59
|
-
* @example common.readDir('./plugins', '.js')
|
|
60
|
-
* @example common.readDir('./plugins', ['.js', '.ts'])
|
|
61
|
-
*/
|
|
62
|
-
readDir(_path: string, ext: string | string[]): string[] | null;
|
|
63
|
-
/**
|
|
64
|
-
* 传入 import.meta.url 自动构建../
|
|
65
|
-
* @param url - import.meta.url
|
|
66
|
-
*/
|
|
67
|
-
urlToPath(url: string): string;
|
|
68
|
-
/**
|
|
69
|
-
* 将文件转换为不带前缀的base64字符串
|
|
70
|
-
* @param file - 文件路径或Buffer对象、可读流对象、http地址、base64://字符串
|
|
71
|
-
* @param - 附加数据
|
|
72
|
-
* @param - 为true时,http地址会直接返回,否则会下载文件并转换为base64字符串
|
|
73
|
-
* @returns 返回base64字符串
|
|
74
|
-
*/
|
|
75
|
-
base64(file: string | Buffer | Readable, options?: {
|
|
76
|
-
http: boolean;
|
|
77
|
-
}): Promise<string>;
|
|
78
|
-
/**
|
|
79
|
-
* 将数据流对象转换为Buffer对象
|
|
80
|
-
* @param {stream.Readable} stream - 要转换的数据流对象
|
|
81
|
-
* @returns {Promise<Buffer>} - 返回Buffer
|
|
82
|
-
*/
|
|
83
|
-
stream(stream: Readable): Promise<Buffer>;
|
|
84
|
-
/**
|
|
85
|
-
* 将文件转换为Buffer对象
|
|
86
|
-
* @param {string|Buffer|http|stream.Readable} file - 文件路径或Buffer对象、可读流对象、http地址、base64://字符串
|
|
87
|
-
* @param {object} options - 附加数据
|
|
88
|
-
* @param {boolean} options.http - 为true时,http地址会直接返回,否则会下载文件并转换为Buffer对象
|
|
89
|
-
* @returns {Promise<Buffer>} - 返回Buffer对象
|
|
90
|
-
*/
|
|
91
|
-
buffer(file: string | Buffer | Readable, options?: {
|
|
92
|
-
http: boolean;
|
|
93
|
-
}): Promise<Buffer | Error | string>;
|
|
94
|
-
/**
|
|
95
|
-
* 标准化发送的消息内容
|
|
96
|
-
* @param elements - 消息内容
|
|
97
|
-
*/
|
|
98
|
-
makeMessage(elements: string | KarinElement | (string | KarinElement)[]): Array<KarinElement>;
|
|
99
|
-
/**
|
|
100
|
-
* 制作简单转发,返回segment.node[]。仅简单包装node,也可以自己组装
|
|
101
|
-
* @param {Array<{object}> | object} elements
|
|
102
|
-
* @param fakeUin 用户id
|
|
103
|
-
* @param fakeNick 用户昵称
|
|
104
|
-
* @return {Array<KarinNodeElement>}
|
|
105
|
-
*/
|
|
106
|
-
makeForward(elements: KarinElement | KarinElement[], fakeUin: string, fakeNick: string): Array<KarinNodeElement>;
|
|
107
|
-
/**
|
|
108
|
-
* 获取所有插件列表
|
|
109
|
-
* @param isDir - 返回绝对路径
|
|
110
|
-
* @param isPack - 屏蔽不带packageon的插件
|
|
111
|
-
*/
|
|
112
|
-
getPlugins(isDir?: boolean, isPack?: boolean): Array<dirName>;
|
|
113
|
-
/**
|
|
114
|
-
* 获取运行时间
|
|
115
|
-
*/
|
|
116
|
-
uptime(): string;
|
|
117
|
-
/**
|
|
118
|
-
* 构建消息体日志
|
|
119
|
-
* @param - 消息体
|
|
120
|
-
*/
|
|
121
|
-
makeMessageLog(message: Array<KarinElement>): string;
|
|
122
|
-
};
|
|
123
|
-
export default _default;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import { AxiosRequestConfig } from 'axios';
|
|
4
|
+
import { Readable } from 'stream';
|
|
5
|
+
import { KarinElement, KarinNodeElement } from '../types/element.js';
|
|
6
|
+
import { dirName } from '../types/plugin.js';
|
|
7
|
+
/**
|
|
8
|
+
* 常用方法
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: {
|
|
11
|
+
streamPipeline: (stream1: Readable, stream2: fs.WriteStream) => Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* 休眠函数
|
|
14
|
+
* @param ms 毫秒
|
|
15
|
+
*/
|
|
16
|
+
sleep(ms: number): Promise<unknown>;
|
|
17
|
+
/**
|
|
18
|
+
* 下载保存文件
|
|
19
|
+
* @param fileUrl 下载地址
|
|
20
|
+
* @param savePath 保存路径
|
|
21
|
+
* @param param axios参数
|
|
22
|
+
*/
|
|
23
|
+
downFile(fileUrl: string, savePath: string, param?: AxiosRequestConfig): Promise<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* 递归创建目录
|
|
26
|
+
* @param dirname - 要创建的文件夹路径
|
|
27
|
+
*/
|
|
28
|
+
mkdir(dirname: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 标准化文件路径
|
|
31
|
+
* @param file - 相对路径
|
|
32
|
+
* @param isDir - 返回绝对路径
|
|
33
|
+
* @param isFile - 添加file://前缀
|
|
34
|
+
* @returns 标准化后的路径
|
|
35
|
+
*/
|
|
36
|
+
absPath(file: string, isDir?: boolean, isFile?: boolean): string;
|
|
37
|
+
/**
|
|
38
|
+
* 判断是否为文件夹
|
|
39
|
+
* @param path - 路径
|
|
40
|
+
* @returns 返回true为文件夹
|
|
41
|
+
*/
|
|
42
|
+
isDir(path: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* 判断是否为插件包
|
|
45
|
+
* @param path - 路径
|
|
46
|
+
* @returns 返回true为插件包
|
|
47
|
+
*/
|
|
48
|
+
isPlugin(path: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 判断路径是否存在
|
|
51
|
+
* @param path - 路径
|
|
52
|
+
* @returns 返回true为存在
|
|
53
|
+
*/
|
|
54
|
+
exists(path: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* 根据文件后缀名从指定路径下读取符合要求的文件
|
|
57
|
+
* @param path - 路径
|
|
58
|
+
* @param ext - 后缀名、或后缀名列表
|
|
59
|
+
* @example common.readDir('./plugins', '.js')
|
|
60
|
+
* @example common.readDir('./plugins', ['.js', '.ts'])
|
|
61
|
+
*/
|
|
62
|
+
readDir(_path: string, ext: string | string[]): string[] | null;
|
|
63
|
+
/**
|
|
64
|
+
* 传入 import.meta.url 自动构建../
|
|
65
|
+
* @param url - import.meta.url
|
|
66
|
+
*/
|
|
67
|
+
urlToPath(url: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* 将文件转换为不带前缀的base64字符串
|
|
70
|
+
* @param file - 文件路径或Buffer对象、可读流对象、http地址、base64://字符串
|
|
71
|
+
* @param - 附加数据
|
|
72
|
+
* @param - 为true时,http地址会直接返回,否则会下载文件并转换为base64字符串
|
|
73
|
+
* @returns 返回base64字符串
|
|
74
|
+
*/
|
|
75
|
+
base64(file: string | Buffer | Readable, options?: {
|
|
76
|
+
http: boolean;
|
|
77
|
+
}): Promise<string>;
|
|
78
|
+
/**
|
|
79
|
+
* 将数据流对象转换为Buffer对象
|
|
80
|
+
* @param {stream.Readable} stream - 要转换的数据流对象
|
|
81
|
+
* @returns {Promise<Buffer>} - 返回Buffer
|
|
82
|
+
*/
|
|
83
|
+
stream(stream: Readable): Promise<Buffer>;
|
|
84
|
+
/**
|
|
85
|
+
* 将文件转换为Buffer对象
|
|
86
|
+
* @param {string|Buffer|http|stream.Readable} file - 文件路径或Buffer对象、可读流对象、http地址、base64://字符串
|
|
87
|
+
* @param {object} options - 附加数据
|
|
88
|
+
* @param {boolean} options.http - 为true时,http地址会直接返回,否则会下载文件并转换为Buffer对象
|
|
89
|
+
* @returns {Promise<Buffer>} - 返回Buffer对象
|
|
90
|
+
*/
|
|
91
|
+
buffer(file: string | Buffer | Readable, options?: {
|
|
92
|
+
http: boolean;
|
|
93
|
+
}): Promise<Buffer | Error | string>;
|
|
94
|
+
/**
|
|
95
|
+
* 标准化发送的消息内容
|
|
96
|
+
* @param elements - 消息内容
|
|
97
|
+
*/
|
|
98
|
+
makeMessage(elements: string | KarinElement | (string | KarinElement)[]): Array<KarinElement>;
|
|
99
|
+
/**
|
|
100
|
+
* 制作简单转发,返回segment.node[]。仅简单包装node,也可以自己组装
|
|
101
|
+
* @param {Array<{object}> | object} elements
|
|
102
|
+
* @param fakeUin 用户id
|
|
103
|
+
* @param fakeNick 用户昵称
|
|
104
|
+
* @return {Array<KarinNodeElement>}
|
|
105
|
+
*/
|
|
106
|
+
makeForward(elements: KarinElement | KarinElement[], fakeUin: string, fakeNick: string): Array<KarinNodeElement>;
|
|
107
|
+
/**
|
|
108
|
+
* 获取所有插件列表
|
|
109
|
+
* @param isDir - 返回绝对路径
|
|
110
|
+
* @param isPack - 屏蔽不带packageon的插件
|
|
111
|
+
*/
|
|
112
|
+
getPlugins(isDir?: boolean, isPack?: boolean): Array<dirName>;
|
|
113
|
+
/**
|
|
114
|
+
* 获取运行时间
|
|
115
|
+
*/
|
|
116
|
+
uptime(): string;
|
|
117
|
+
/**
|
|
118
|
+
* 构建消息体日志
|
|
119
|
+
* @param - 消息体
|
|
120
|
+
*/
|
|
121
|
+
makeMessageLog(message: Array<KarinElement>): string;
|
|
122
|
+
};
|
|
123
|
+
export default _default;
|