koishi-plugin-csss 1.1.2 → 1.1.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.d.ts +0 -1
- package/lib/index.js +3 -6
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -36,7 +36,6 @@ var Config = import_koishi.Schema.object({
|
|
|
36
36
|
showVAC: import_koishi.Schema.boolean().default(true).description("是否显示VAC状态"),
|
|
37
37
|
showPassword: import_koishi.Schema.boolean().default(true).description("是否显示密码保护信息"),
|
|
38
38
|
generateImage: import_koishi.Schema.boolean().default(true).description("是否生成图片横幅(影响cs和csss命令)"),
|
|
39
|
-
imageWidth: import_koishi.Schema.number().min(600).max(2e3).default(1200).description("图片宽度(像素)"),
|
|
40
39
|
imageHeight: import_koishi.Schema.number().min(200).max(2500).default(500).description("图片最小高度(像素),实际高度会根据内容自适应"),
|
|
41
40
|
fontSize: import_koishi.Schema.number().min(12).max(48).default(24).description("字体大小"),
|
|
42
41
|
fontFamily: import_koishi.Schema.string().default("Microsoft YaHei, sans-serif").description("字体家族"),
|
|
@@ -534,7 +533,7 @@ ${textMessage}`;
|
|
|
534
533
|
__name(calculateImageHeight, "calculateImageHeight");
|
|
535
534
|
async function generateServerImage(data, host, port) {
|
|
536
535
|
const { result } = data;
|
|
537
|
-
const width =
|
|
536
|
+
const width = 1200;
|
|
538
537
|
const height = calculateImageHeight(data);
|
|
539
538
|
const canvas = await ctx.canvas.createCanvas(width, height);
|
|
540
539
|
const ctx2d = canvas.getContext("2d");
|
|
@@ -785,8 +784,7 @@ cs.schedule -q # 测试QQ适配器连接`;
|
|
|
785
784
|
return import_koishi.h.image(imageBuffer, "image/png");
|
|
786
785
|
} catch (imageError) {
|
|
787
786
|
console.error("生成图片失败:", imageError);
|
|
788
|
-
return `生成图片失败: ${imageError.message}
|
|
789
|
-
将返回文本信息。`;
|
|
787
|
+
return `生成图片失败: ${imageError.message}`;
|
|
790
788
|
}
|
|
791
789
|
}
|
|
792
790
|
let message = formatServerInfo(data);
|
|
@@ -846,7 +844,6 @@ cs.schedule -q # 测试QQ适配器连接`;
|
|
|
846
844
|
显示VAC状态: ${config.showVAC ? "是" : "否"}
|
|
847
845
|
显示密码保护: ${config.showPassword ? "是" : "否"}
|
|
848
846
|
生成图片横幅: ${config.generateImage ? "是" : "否"}
|
|
849
|
-
图片宽度: ${config.imageWidth}px
|
|
850
847
|
图片最小高度: ${config.imageHeight}px
|
|
851
848
|
字体大小: ${config.fontSize}px
|
|
852
849
|
群组ID格式: ${config.useFullChannelId ? "适配器:群号" : "群号"}
|
|
@@ -968,7 +965,7 @@ cs.help - 显示此帮助
|
|
|
968
965
|
});
|
|
969
966
|
}
|
|
970
967
|
__name(apply, "apply");
|
|
971
|
-
var inject = ["canvas", "gamedig"];
|
|
968
|
+
var inject = ["canvas", "gamedig", "database"];
|
|
972
969
|
// Annotate the CommonJS export names for ESM import in node:
|
|
973
970
|
0 && (module.exports = {
|
|
974
971
|
Config,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-csss",
|
|
3
3
|
"description": "Check the status of the CS server",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.4",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"koishi",
|
|
15
15
|
"plugin"
|
|
16
16
|
],
|
|
17
|
-
"
|
|
17
|
+
"devDependencies": {
|
|
18
18
|
"koishi": "^4.18.7",
|
|
19
19
|
"koishi-plugin-canvas": "^0.2.2",
|
|
20
20
|
"koishi-plugin-gamedig": "^1.2.2"
|
|
21
21
|
},
|
|
22
|
-
"
|
|
22
|
+
"peerDependencies": {
|
|
23
23
|
"koishi": "^4.18.7",
|
|
24
24
|
"koishi-plugin-canvas": "^0.2.2",
|
|
25
25
|
"koishi-plugin-gamedig": "^1.2.2"
|