@azimiao/koishi-plugin-cafe-bot-exp 0.0.30 → 0.0.32
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 +20 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -40,7 +40,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
40
40
|
var import_url = require("url");
|
|
41
41
|
|
|
42
42
|
// package.json
|
|
43
|
-
var version = "0.0.
|
|
43
|
+
var version = "0.0.32";
|
|
44
44
|
|
|
45
45
|
// src/index.ts
|
|
46
46
|
var import_censor = require("@koishijs/censor");
|
|
@@ -524,7 +524,9 @@ var CafeBotQuizConfig = import_koishi3.Schema.object({
|
|
|
524
524
|
qqQuizMDTextID: import_koishi3.Schema.string().description("QQ markdown 纯本文模板ID"),
|
|
525
525
|
qqQuizMDImgID: import_koishi3.Schema.string().description("QQ markdown 题目带图模板ID"),
|
|
526
526
|
qqQuizButtonID: import_koishi3.Schema.string().description("QQ按钮ID"),
|
|
527
|
-
appendMDBtn: import_koishi3.Schema.boolean().description("是否追加QQ按钮").default(false)
|
|
527
|
+
appendMDBtn: import_koishi3.Schema.boolean().description("是否追加QQ按钮").default(false),
|
|
528
|
+
imgWidth: import_koishi3.Schema.number().description("QQ图像宽度").default(0),
|
|
529
|
+
imgHeight: import_koishi3.Schema.number().description("QQ图像高度").default(0)
|
|
528
530
|
}).description("答题配置");
|
|
529
531
|
|
|
530
532
|
// src/common/CafeTimeTools.ts
|
|
@@ -697,7 +699,8 @@ async function apply2(ctx, config) {
|
|
|
697
699
|
params: [
|
|
698
700
|
{
|
|
699
701
|
key: "user",
|
|
700
|
-
values: [
|
|
702
|
+
values: [argv.session && !argv.session.isDirect ? `<qqbot-at-user id="${argv.session.userId}"` : ""]
|
|
703
|
+
// 群聊能@,私聊不能@
|
|
701
704
|
},
|
|
702
705
|
{
|
|
703
706
|
key: "question",
|
|
@@ -726,6 +729,20 @@ async function apply2(ctx, config) {
|
|
|
726
729
|
]
|
|
727
730
|
}
|
|
728
731
|
};
|
|
732
|
+
if (qItem.question.img.length > 0) {
|
|
733
|
+
msgQQ.markdown.params.push({
|
|
734
|
+
key: "img_url",
|
|
735
|
+
values: [qItem.question.img]
|
|
736
|
+
});
|
|
737
|
+
msgQQ.markdown.params.push({
|
|
738
|
+
key: "img_width",
|
|
739
|
+
values: [config.imgWidth]
|
|
740
|
+
});
|
|
741
|
+
msgQQ.markdown.params.push({
|
|
742
|
+
key: "img_height",
|
|
743
|
+
values: [config.imgHeight]
|
|
744
|
+
});
|
|
745
|
+
}
|
|
729
746
|
if (config.appendMDBtn) {
|
|
730
747
|
msgQQ.keyboard = {
|
|
731
748
|
id: config.qqQuizButtonID
|