koishi-plugin-best-cave 1.5.11 → 1.6.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/lib/index.js +3 -11
- package/package.json +9 -8
package/lib/index.js
CHANGED
|
@@ -1300,17 +1300,9 @@ async function sendMessage(session, key, params = [], isTemp = true, timeout = 1
|
|
|
1300
1300
|
}
|
|
1301
1301
|
__name(sendMessage, "sendMessage");
|
|
1302
1302
|
async function processMediaFile(filePath, type) {
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
return filePath;
|
|
1307
|
-
} else {
|
|
1308
|
-
const data = await fs5.promises.readFile(filePath);
|
|
1309
|
-
return `data:${type}/mp4;base64,${data.toString("base64")}`;
|
|
1310
|
-
}
|
|
1311
|
-
} catch {
|
|
1312
|
-
return null;
|
|
1313
|
-
}
|
|
1303
|
+
const data = await fs5.promises.readFile(filePath).catch(() => null);
|
|
1304
|
+
if (!data) return null;
|
|
1305
|
+
return `data:${type}/${type === "image" ? "png" : "mp4"};base64,${data.toString("base64")}`;
|
|
1314
1306
|
}
|
|
1315
1307
|
__name(processMediaFile, "processMediaFile");
|
|
1316
1308
|
async function extractMediaContent(originalContent, config, session) {
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-best-cave",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "1.
|
|
3
|
+
"description": "功能最强的 cave 插件,支持黑白名单、审核与自动查重,人性化的添加方式,可添加图文甚至视频,可查阅投稿列表,完善的 ID 管理与 Hash 校验机制,比你听过的任何 cave 都强!",
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Yis_Rime <yis_rime@outlook.com>"
|
|
7
7
|
],
|
|
8
|
+
"homepage": "https://github.com/YisRime/koishi-plugin-best-cave",
|
|
8
9
|
"repository": {
|
|
9
10
|
"type": "git",
|
|
10
11
|
"url": "git+https://github.com/YisRime/koishi-plugin-best-cave.git"
|
|
@@ -15,22 +16,22 @@
|
|
|
15
16
|
"lib",
|
|
16
17
|
"dist"
|
|
17
18
|
],
|
|
18
|
-
"license": "
|
|
19
|
+
"license": "GPL-3.0",
|
|
19
20
|
"scripts": {},
|
|
20
21
|
"keywords": [
|
|
21
22
|
"chatbot",
|
|
22
23
|
"koishi",
|
|
23
24
|
"plugin",
|
|
24
|
-
"cave"
|
|
25
|
+
"cave",
|
|
26
|
+
"回声洞",
|
|
27
|
+
"PCL"
|
|
25
28
|
],
|
|
26
29
|
"devDependencies": {},
|
|
27
30
|
"peerDependencies": {
|
|
28
31
|
"koishi": "^4.18.3",
|
|
29
|
-
"sharp": "^0.33.5"
|
|
30
|
-
"koishi-plugin-adapter-onebot": "^6.1.3"
|
|
32
|
+
"sharp": "^0.33.5"
|
|
31
33
|
},
|
|
32
34
|
"dependencies": {
|
|
33
|
-
"sharp": "^0.33.5"
|
|
34
|
-
"koishi-plugin-adapter-onebot": "^6.1.3"
|
|
35
|
+
"sharp": "^0.33.5"
|
|
35
36
|
}
|
|
36
37
|
}
|