koishi-plugin-echo-cave 1.34.1 → 1.34.3
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.cjs +10 -5
- package/lib/utils/media/media-helper.d.ts +2 -0
- package/package.json +9 -9
package/lib/index.cjs
CHANGED
|
@@ -667,7 +667,8 @@ async function loadMediaBuffer(ctx, fileRef, cfg) {
|
|
|
667
667
|
throw new Error(`Failed to fetch remote media: HTTP ${response.status}`);
|
|
668
668
|
}
|
|
669
669
|
const contentTypeHeader = response.headers["content-type"];
|
|
670
|
-
const
|
|
670
|
+
const firstContentType = Array.isArray(contentTypeHeader) ? contentTypeHeader[0] : contentTypeHeader;
|
|
671
|
+
const contentType = typeof firstContentType === "string" ? firstContentType : void 0;
|
|
671
672
|
return {
|
|
672
673
|
buffer: Buffer.from(response.data),
|
|
673
674
|
contentType,
|
|
@@ -1293,13 +1294,17 @@ async function messageContainsMedia(content) {
|
|
|
1293
1294
|
return false;
|
|
1294
1295
|
}
|
|
1295
1296
|
async function ensureMediaSaveProgress(progressOptions) {
|
|
1296
|
-
if (!progressOptions || progressOptions.state.
|
|
1297
|
+
if (!progressOptions || progressOptions.state.progressMessageRequested) {
|
|
1297
1298
|
return;
|
|
1298
1299
|
}
|
|
1299
1300
|
const { session, state } = progressOptions;
|
|
1300
|
-
state.
|
|
1301
|
-
|
|
1302
|
-
|
|
1301
|
+
state.progressMessageRequested = true;
|
|
1302
|
+
state.progressMessagePromise = (async () => {
|
|
1303
|
+
state.progressMessageIds = await session.send(
|
|
1304
|
+
session.text("commands.cave.echo.messages.mediaSaving")
|
|
1305
|
+
);
|
|
1306
|
+
})();
|
|
1307
|
+
await state.progressMessagePromise;
|
|
1303
1308
|
}
|
|
1304
1309
|
async function resolveMediaElementForSend(ctx, element, cfg) {
|
|
1305
1310
|
if (isMediaType(element.type)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-echo-cave",
|
|
3
3
|
"description": "Group echo cave",
|
|
4
|
-
"version": "1.34.
|
|
4
|
+
"version": "1.34.3",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
@@ -36,23 +36,23 @@
|
|
|
36
36
|
"koishi": "^4.18.11"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@aws-sdk/client-s3": "^3.
|
|
40
|
-
"@aws-sdk/s3-request-presigner": "^3.
|
|
39
|
+
"@aws-sdk/client-s3": "^3.1053.0",
|
|
40
|
+
"@aws-sdk/s3-request-presigner": "^3.1053.0",
|
|
41
41
|
"@pynickle/koishi-plugin-adapter-onebot": "^1.0.0",
|
|
42
|
-
"axios": "^1.
|
|
43
|
-
"uuid": "^
|
|
42
|
+
"axios": "^1.16.1",
|
|
43
|
+
"uuid": "^14.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@semantic-release/changelog": "^6.0.3",
|
|
47
47
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
48
48
|
"@semantic-release/git": "^10.0.1",
|
|
49
49
|
"@semantic-release/npm": "^13.1.5",
|
|
50
|
-
"@semantic-release/release-notes-generator": "^14.1.
|
|
51
|
-
"@types/node": "^
|
|
50
|
+
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
51
|
+
"@types/node": "^25.9.1",
|
|
52
52
|
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
53
53
|
"esbuild": "^0.28.0",
|
|
54
|
-
"oxfmt": "^0.
|
|
55
|
-
"oxlint": "^1.
|
|
54
|
+
"oxfmt": "^0.51.0",
|
|
55
|
+
"oxlint": "^1.66.0",
|
|
56
56
|
"semantic-release": "^25.0.3",
|
|
57
57
|
"typescript": "^6.0.3"
|
|
58
58
|
}
|