@azimiao/koishi-plugin-cafe-bot-exp 0.0.36 → 0.0.37
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 +15 -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.37";
|
|
44
44
|
|
|
45
45
|
// src/index.ts
|
|
46
46
|
var import_censor = require("@koishijs/censor");
|
|
@@ -526,7 +526,9 @@ var CafeBotQuizConfig = import_koishi3.Schema.object({
|
|
|
526
526
|
qqQuizButtonID: import_koishi3.Schema.string().description("QQ按钮ID"),
|
|
527
527
|
appendMDBtn: import_koishi3.Schema.boolean().description("是否追加QQ按钮").default(false),
|
|
528
528
|
imgWidth: import_koishi3.Schema.number().description("QQ图像宽度").default(0),
|
|
529
|
-
imgHeight: import_koishi3.Schema.number().description("QQ图像高度").default(0)
|
|
529
|
+
imgHeight: import_koishi3.Schema.number().description("QQ图像高度").default(0),
|
|
530
|
+
disableDriectMD: import_koishi3.Schema.boolean().description("j禁用私聊 MD 回复").default(true),
|
|
531
|
+
disableDirectMDReply: import_koishi3.Schema.string().default("暂不支持私聊回复哦,请从群聊@我吧")
|
|
530
532
|
}).description("答题配置");
|
|
531
533
|
|
|
532
534
|
// src/common/CafeTimeTools.ts
|
|
@@ -750,7 +752,17 @@ async function apply2(ctx, config) {
|
|
|
750
752
|
}
|
|
751
753
|
if (argv.session.qq) {
|
|
752
754
|
try {
|
|
753
|
-
|
|
755
|
+
if (argv.session.isDirect) {
|
|
756
|
+
if (config.disableDirectMDReply) {
|
|
757
|
+
await ctx.cache.delete("question", argv.session.userId);
|
|
758
|
+
await argv.session?.send(`${At(argv)}${config.disableDirectMDReply}`);
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
logger2?.info("private msg,use sendPrivateMessage,channelId:" + argv.session.channelId);
|
|
762
|
+
await argv.session.bot.internal.sendPrivateMessage(argv.session.channelId, msgQQ);
|
|
763
|
+
} else {
|
|
764
|
+
await argv.session.bot.internal.sendMessage(argv.session.channelId, msgQQ);
|
|
765
|
+
}
|
|
754
766
|
} catch (error) {
|
|
755
767
|
logger2?.error("发送QQ MD 消息失败:" + error);
|
|
756
768
|
logger2?.error(JSON.stringify(msgQQ));
|