node-karin 0.5.1 → 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.
- 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/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 +1 -0
- package/lib/index.js +1 -0
- package/lib/modules.d.ts +2 -1
- package/lib/modules.js +2 -1
- 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/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 -2
package/lib/utils/segment.js
CHANGED
|
@@ -77,7 +77,7 @@ export const segment = new (class Segment {
|
|
|
77
77
|
const file_type = options.file_type || 'original'
|
|
78
78
|
const name = options.name || ''
|
|
79
79
|
const md5 = options.md5 || ''
|
|
80
|
-
const sub_type = options.sub_type ||
|
|
80
|
+
const sub_type = options.sub_type || ''
|
|
81
81
|
const width = options.width || 0
|
|
82
82
|
const height = options.height || 0
|
|
83
83
|
return {
|
|
@@ -118,6 +118,7 @@ export const segment = new (class Segment {
|
|
|
118
118
|
* @param md5 - 语音md5
|
|
119
119
|
* @param name - 语音名称
|
|
120
120
|
* @returns {VoiceElement} 语音元素
|
|
121
|
+
* @deprecated 即将废弃 请使用segment.record
|
|
121
122
|
*/
|
|
122
123
|
voice (file, magic = false, md5 = '', name = '') {
|
|
123
124
|
return {
|
|
@@ -206,7 +207,7 @@ export const segment = new (class Segment {
|
|
|
206
207
|
* @param pic - 封面
|
|
207
208
|
* @returns {CustomMusicElemen} 自定义音乐元素
|
|
208
209
|
*/
|
|
209
|
-
customMusic (url, audio, title, author, pic) {
|
|
210
|
+
customMusic (url, audio, title, author, pic, id) {
|
|
210
211
|
return {
|
|
211
212
|
type: 'music',
|
|
212
213
|
platform: 'custom',
|
|
@@ -215,6 +216,7 @@ export const segment = new (class Segment {
|
|
|
215
216
|
title,
|
|
216
217
|
author,
|
|
217
218
|
pic,
|
|
219
|
+
id,
|
|
218
220
|
}
|
|
219
221
|
}
|
|
220
222
|
|
package/modules.d.ts
CHANGED
|
@@ -11,4 +11,5 @@ import { Level as level } from 'level';
|
|
|
11
11
|
import schedule from 'node-schedule';
|
|
12
12
|
import yaml from 'yaml';
|
|
13
13
|
import log4js from 'log4js';
|
|
14
|
-
|
|
14
|
+
import art_template from 'art-template';
|
|
15
|
+
export { fs, ws, path, axios, lodash, moment, express, chalk, chokidar, level, schedule, yaml, log4js, art_template, };
|
package/modules.js
CHANGED
|
@@ -11,4 +11,5 @@ import { Level as level } from 'level';
|
|
|
11
11
|
import schedule from 'node-schedule';
|
|
12
12
|
import yaml from 'yaml';
|
|
13
13
|
import log4js from 'log4js';
|
|
14
|
-
|
|
14
|
+
import art_template from 'art-template';
|
|
15
|
+
export { fs, ws, path, axios, lodash, moment, express, chalk, chokidar, level, schedule, yaml, log4js, art_template, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-karin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "基于 Kritor 进行开发的nodejs机器人框架",
|
|
6
6
|
"homepage": "https://github.com/KarinJS/Karin",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"cp": "cp ./lib/modules.d.ts ./modules.d.ts && cp ./lib/modules.js ./modules.js",
|
|
43
43
|
"delete": "pm2 delete ./config/config/pm2.yaml",
|
|
44
44
|
"dev": "tsx ./lib/index.js --dev",
|
|
45
|
+
"debug": "tsx watch ./lib/index.js --dev",
|
|
45
46
|
"fix": "eslint lib/**/*.js --fix",
|
|
46
47
|
"fix:all": "eslint lib/**/*.js --fix && eslint lib/**/*.ts --fix",
|
|
47
48
|
"init": "node lib/tools/install.js",
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
"chalk": "5.3.0",
|
|
66
67
|
"chokidar": "3.6.0",
|
|
67
68
|
"express": "4.19.2",
|
|
68
|
-
"kritor-proto": "^1.0.
|
|
69
|
+
"kritor-proto": "^1.0.2",
|
|
69
70
|
"level": "8.0.1",
|
|
70
71
|
"lodash": "4.17.21",
|
|
71
72
|
"log4js": "6.9.1",
|