koishi-plugin-starfx-bot 0.16.3 → 0.16.4
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 +2 -2
- package/lib/utils.d.ts +2 -2
- package/package.json +1 -2
- package/readme.md +1 -0
package/lib/index.js
CHANGED
|
@@ -604,7 +604,7 @@ __name(ready, "ready");
|
|
|
604
604
|
|
|
605
605
|
// src/index.ts
|
|
606
606
|
var import_node_path2 = __toESM(require("node:path"));
|
|
607
|
-
var
|
|
607
|
+
var import_mime_types = __toESM(require("mime-types"));
|
|
608
608
|
var name = "starfx-bot";
|
|
609
609
|
var baseDir;
|
|
610
610
|
var assetsDir;
|
|
@@ -874,7 +874,7 @@ function apply(ctx, cfg) {
|
|
|
874
874
|
for (const element of session.elements) {
|
|
875
875
|
const src = element.attrs?.src;
|
|
876
876
|
if (!src || !isLocalPath(src)) continue;
|
|
877
|
-
const mimeType =
|
|
877
|
+
const mimeType = import_mime_types.default.lookup(src) || guessTypeFromElement(element.type) || "application/octet-stream";
|
|
878
878
|
const base64 = toBase64String(src);
|
|
879
879
|
if (base64) element.attrs.src = `data:${mimeType};base64,${base64}`;
|
|
880
880
|
}
|
package/lib/utils.d.ts
CHANGED
|
@@ -80,14 +80,14 @@ export declare function handleBanGDreamConfig(options: any): Promise<{
|
|
|
80
80
|
* @param baseImage 被封印的图片url
|
|
81
81
|
* @return 画完的图片 h对象
|
|
82
82
|
*/
|
|
83
|
-
export declare function drawLock(ctx: Context, baseImage: string): Promise<
|
|
83
|
+
export declare function drawLock(ctx: Context, baseImage: string): Promise<h | "输入无效" | "发生错误">;
|
|
84
84
|
/**
|
|
85
85
|
* "卖掉了"绘图函数
|
|
86
86
|
* @param ctx
|
|
87
87
|
* @param baseImage
|
|
88
88
|
* @return 画完的图片 h对象
|
|
89
89
|
*/
|
|
90
|
-
export declare function drawSold(ctx: Context, baseImage: string): Promise<
|
|
90
|
+
export declare function drawSold(ctx: Context, baseImage: string): Promise<h | "输入无效" | "发生错误">;
|
|
91
91
|
/**
|
|
92
92
|
* 从url下载图片并返回sharp对象
|
|
93
93
|
* @param ctx Context
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"contributors": [
|
|
5
5
|
"StarFreedomX <starfreedomx@outlook.com>"
|
|
6
6
|
],
|
|
7
|
-
"version": "0.16.
|
|
7
|
+
"version": "0.16.4",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"typings": "lib/index.d.ts",
|
|
10
10
|
"files": [
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"http-proxy-agent": "^7.0.2",
|
|
42
42
|
"https-proxy-agent": "^7.0.6",
|
|
43
43
|
"jimp": "^1.6.0",
|
|
44
|
-
"mime": "^3.0.0",
|
|
45
44
|
"mime-types": "^3.0.1",
|
|
46
45
|
"rss-parser": "^3.13.0",
|
|
47
46
|
"sharp": "^0.34.1"
|
package/readme.md
CHANGED