@azimiao/koishi-plugin-cafe-bot-exp 0.0.26 → 0.0.27-beta2

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.
@@ -7,4 +7,9 @@ export declare const name = "cafe-bot-exp.cat";
7
7
  export interface Config extends CafeBotCatConfig {
8
8
  }
9
9
  export declare const Config: Schema<Config>;
10
+ export declare const injectDepend: {
11
+ required: any[];
12
+ optional: string[];
13
+ };
14
+ export declare const inject: any[];
10
15
  export declare function apply(ctx: Context): Promise<void>;
@@ -4,6 +4,10 @@
4
4
  import { Context, Schema } from 'koishi';
5
5
  import { CafeBotDrawConfig } from './config';
6
6
  export declare const name = "cafe-bot-exp.draw";
7
+ export declare const injectDepend: {
8
+ required: string[];
9
+ optional: string[];
10
+ };
7
11
  export declare const inject: string[];
8
12
  export interface Config extends CafeBotDrawConfig {
9
13
  }
package/lib/index.d.ts CHANGED
@@ -3,10 +3,15 @@
3
3
  */
4
4
  import { Context } from 'koishi';
5
5
  import { Config } from './config';
6
+ import '@koishijs/censor';
7
+ import * as draw from "./draw/index";
8
+ import * as quiz from "./quiz/index";
9
+ import * as cat from "./cat/index";
6
10
  export declare const name = "cafe-bot-exp";
7
11
  export * from "./config";
12
+ export declare const plugins: (typeof draw | typeof quiz | typeof cat)[];
8
13
  export declare const inject: {
9
- required: string[];
14
+ required: any[];
10
15
  optional: string[];
11
16
  };
12
17
  export declare function apply(ctx: Context, config: Config): Promise<void>;
package/lib/index.js CHANGED
@@ -32,16 +32,18 @@ var src_exports = {};
32
32
  __export(src_exports, {
33
33
  Config: () => Config4,
34
34
  apply: () => apply4,
35
- inject: () => inject3,
36
- name: () => name4
35
+ inject: () => inject4,
36
+ name: () => name4,
37
+ plugins: () => plugins
37
38
  });
38
39
  module.exports = __toCommonJS(src_exports);
39
40
  var import_url = require("url");
40
41
 
41
42
  // package.json
42
- var version = "0.0.26";
43
+ var version = "0.0.27-beta2";
43
44
 
44
45
  // src/index.ts
46
+ var import_censor = require("@koishijs/censor");
45
47
  var fs4 = __toESM(require("fs/promises"));
46
48
  var path3 = __toESM(require("path"));
47
49
 
@@ -51,6 +53,7 @@ __export(draw_exports, {
51
53
  Config: () => Config,
52
54
  apply: () => apply,
53
55
  inject: () => inject,
56
+ injectDepend: () => injectDepend,
54
57
  name: () => name
55
58
  });
56
59
  var fs2 = __toESM(require("fs/promises"));
@@ -97,12 +100,12 @@ var PseudoRandom = class {
97
100
  "seed": this.seed
98
101
  });
99
102
  }
100
- next = () => {
103
+ next = /* @__PURE__ */ __name(() => {
101
104
  return this.randFunc();
102
- };
103
- nextInt = (min, max) => {
105
+ }, "next");
106
+ nextInt = /* @__PURE__ */ __name((min, max) => {
104
107
  return Math.floor(this.next() * (max - min + 1)) + min;
105
- };
108
+ }, "nextInt");
106
109
  };
107
110
  var PseudoRandom_default = PseudoRandom;
108
111
 
@@ -316,7 +319,11 @@ var downloadTool_default = downloadFileIfNotExist;
316
319
 
317
320
  // src/draw/index.ts
318
321
  var name = "cafe-bot-exp.draw";
319
- var inject = ["http", "logger"];
322
+ var injectDepend = {
323
+ required: ["http"],
324
+ optional: ["logger"]
325
+ };
326
+ var inject = ["http"];
320
327
  var Config = CafeBotDrawConfig;
321
328
  var animals = ["瑟蕾奴", "可鲁贝洛斯", "捷欧", "基库", "蔡特", "柯贝", "古利亚诺斯", "小星", "影良", "fio", "xeros"];
322
329
  var starEnum = [5, 4, 3, 2, 1];
@@ -491,103 +498,37 @@ async function apply(ctx, config) {
491
498
  }
492
499
  __name(apply, "apply");
493
500
 
494
- // src/cat/index.ts
495
- var cat_exports = {};
496
- __export(cat_exports, {
497
- Config: () => Config2,
498
- apply: () => apply2,
499
- name: () => name2
500
- });
501
- var import_koishi4 = require("koishi");
502
-
503
- // src/cat/config.ts
504
- var import_koishi3 = require("koishi");
505
- var CafeBotCatConfig = import_koishi3.Schema.object({
506
- catName: import_koishi3.Schema.string().description("名称/占位").default("柯贝")
507
- }).description("猫猫配置");
508
-
509
- // src/cat/index.ts
510
- var name2 = "cafe-bot-exp.cat";
511
- var Config2 = CafeBotCatConfig;
512
- var catWords = [
513
- "喵呀呜~ ",
514
- "喵呀~呵",
515
- // 走这边。(带路时)
516
- "喵呀~~噢",
517
- // 说得没错。就是这样。
518
- "喵呀~嘎~",
519
- // 高兴的表现。
520
- "喵呀~~呵",
521
- // 稍等一下。(引起注意)
522
- "喵嘎",
523
- // 爪子痒痒了。(焦躁不安)
524
- "喵嘎~~ ",
525
- // 肚子饿了。
526
- "喵嘎呜~~",
527
- // 警戒的表现。
528
- "喵呜",
529
- // 困了。乏了。累了。
530
- "喵呜?",
531
- // 您是哪位?
532
- "喵呜—",
533
- // 是的。
534
- "喵噢?",
535
- // 怎么了?
536
- "喵—噢",
537
- // 呦,又见面了。 (短期内再会时的招呼)
538
- "喵—呵",
539
- // 好久不见了。还好吗?
540
- "喵~呜",
541
- // 再见
542
- "喵~噢",
543
- // 是,就是这样。(强烈肯定)
544
- "喵~~呵",
545
- // 你好。
546
- "呜咪嘎~ ",
547
- // 打哈欠。
548
- "咪呜?",
549
- // 你说什么?(听到坏话反问的语气)
550
- "咪~呜 ",
551
- // 肚子饿了。(幼猫语)
552
- "咪~~呵"
553
- // 对不起
554
- ];
555
- async function apply2(ctx) {
556
- ctx.command("黑猫柯贝/摸猫", "摸摸柯贝").action(async (argv, _) => {
557
- const random = new import_koishi4.Random(() => Math.random());
558
- let catWord = random.pick(catWords);
559
- argv.session?.send(`${At(argv)}🐱:${catWord}`);
560
- });
561
- }
562
- __name(apply2, "apply");
563
-
564
501
  // src/quiz/index.ts
565
502
  var quiz_exports = {};
566
503
  __export(quiz_exports, {
567
- Config: () => Config3,
568
- apply: () => apply3,
504
+ Config: () => Config2,
505
+ apply: () => apply2,
569
506
  inject: () => inject2,
570
- name: () => name3
507
+ injectDepend: () => injectDepend2,
508
+ name: () => name2
571
509
  });
572
- var import_koishi6 = require("koishi");
510
+ var import_koishi4 = require("koishi");
573
511
  var fs3 = __toESM(require("fs/promises"));
574
512
  var path2 = __toESM(require("path"));
575
513
 
576
514
  // src/quiz/config.ts
577
- var import_koishi5 = require("koishi");
578
- var CafeBotQuizConfig = import_koishi5.Schema.object({
579
- baseQuizUrl: import_koishi5.Schema.string().description("答题列表 Url").default("https://www.azimiao.com/quiz.json"),
580
- forceUpdateWhenLoad: import_koishi5.Schema.boolean().description("插件加载时强制更新题目列表").default(false),
581
- answerTimeout: import_koishi5.Schema.number().description("回答超时时间(秒)").default(300),
582
- maxQuizPerDay: import_koishi5.Schema.number().description("每日单人最大答题数").default(5),
583
- redisServer: import_koishi5.Schema.string().description("redis服务器地址"),
515
+ var import_koishi3 = require("koishi");
516
+ var CafeBotQuizConfig = import_koishi3.Schema.object({
517
+ baseQuizUrl: import_koishi3.Schema.string().description("答题列表 Url").default("https://www.azimiao.com/quiz.json"),
518
+ forceUpdateWhenLoad: import_koishi3.Schema.boolean().description("插件加载时强制更新题目列表").default(false),
519
+ answerTimeout: import_koishi3.Schema.number().description("回答超时时间(秒)").default(300),
520
+ maxQuizPerDay: import_koishi3.Schema.number().description("每日单人最大答题数").default(5),
521
+ redisServer: import_koishi3.Schema.string().description("redis服务器地址"),
584
522
  // TODO: 计划: 分数存储使用 sqlite, 临时数据(如当前题目)用内存就行了?
585
- redisAuth: import_koishi5.Schema.string().description("redis服务器密码")
523
+ redisAuth: import_koishi3.Schema.string().description("redis服务器密码"),
524
+ qqQuizMDTextID: import_koishi3.Schema.string().description("QQ markdown 纯本文模板ID"),
525
+ qqQuizMDImgID: import_koishi3.Schema.string().description("QQ markdown 题目带图模板ID"),
526
+ qqQuizButtonID: import_koishi3.Schema.string().description("QQ按钮ID")
586
527
  }).description("答题配置");
587
528
 
588
529
  // src/common/CafeTimeTools.ts
589
530
  var CafeTimeTools = {
590
- getRemainingSecondsToBeijingMidnight: function() {
531
+ getRemainingSecondsToBeijingMidnight: /* @__PURE__ */ __name(function() {
591
532
  const now = /* @__PURE__ */ new Date();
592
533
  const utcNow = now.getTime();
593
534
  const target = new Date(now);
@@ -598,14 +539,18 @@ var CafeTimeTools = {
598
539
  const diff = target.getTime() - utcNow;
599
540
  const seconds = Math.ceil(diff / 1e3);
600
541
  return seconds;
601
- }
542
+ }, "getRemainingSecondsToBeijingMidnight")
602
543
  };
603
544
  var CafeTimeTools_default = CafeTimeTools;
604
545
 
605
546
  // src/quiz/index.ts
606
- var name3 = "cafe-bot-exp.quiz";
607
- var inject2 = ["http", "cache", "logger"];
608
- var Config3 = CafeBotQuizConfig;
547
+ var name2 = "cafe-bot-exp.quiz";
548
+ var injectDepend2 = {
549
+ required: ["http", "cache", "database"],
550
+ optional: ["censor", "logger"]
551
+ };
552
+ var inject2 = ["http", "cache", "database"];
553
+ var Config2 = CafeBotQuizConfig;
609
554
  var validOptions = {
610
555
  "A": 0,
611
556
  "B": 1,
@@ -627,7 +572,7 @@ async function downloadQuitDataIfNotExist(ctx, config, forceUpdate) {
627
572
  if (!forceUpdate && quizDataIds != null && quizDataIds.length > 0) {
628
573
  return;
629
574
  }
630
- const root = path2.join(ctx.baseDir, "data", `${name3}-data`);
575
+ const root = path2.join(ctx.baseDir, "data", `${name2}-data`);
631
576
  await fs3.mkdir(root, { recursive: true });
632
577
  const quizFilePath = path2.join(root, "quiz.json");
633
578
  await downloadTool_default(ctx.http, config.baseQuizUrl, quizFilePath, forceUpdate);
@@ -680,13 +625,13 @@ async function answerHandler(ctx, config, argv, answer) {
680
625
  var qItem = quizDataSet[lastQuestion.question];
681
626
  logger2?.info(`${argv.session.userId} try answer quiz(id:${lastQuestion.question}): right answer:${lastQuestion.answer}, input answer:${selectNumber}`);
682
627
  if (qItem && lastQuestion.answer == selectNumber) {
683
- await argv.session?.send(`${At(argv)}回答正确😊${qItem.explain.length > 0 ? "" + qItem.explain : ""}`);
628
+ await argv.session?.send(`${At(argv)}回答正确😊${qItem.explain.length > 0 ? `,${ctx.censor ? "<censor>" : ""}` + qItem.explain + `${ctx.censor ? "</censor>" : ""}` : ""}`);
684
629
  await ctx.database.set("cafeQuiz", userQuizA.id, {
685
630
  right: userQuizA.right + 1
686
631
  });
687
632
  return;
688
633
  } else {
689
- await argv.session?.send(`${At(argv)}回答错误😟${qItem.explain2.length > 0 ? "" + qItem.explain2 : ""}`);
634
+ await argv.session?.send(`${At(argv)}回答错误😟${qItem.explain2.length > 0 ? `,${ctx.censor ? "<censor>" : ""}` + qItem.explain2 + `${ctx.censor ? "</censor>" : ""}` : ""}`);
690
635
  await ctx.database.set("cafeQuiz", userQuizA.id, {
691
636
  wrong: userQuizA.wrong + 1
692
637
  });
@@ -694,8 +639,8 @@ async function answerHandler(ctx, config, argv, answer) {
694
639
  }
695
640
  }
696
641
  __name(answerHandler, "answerHandler");
697
- async function apply3(ctx, config) {
698
- logger2 = ctx.logger(name3);
642
+ async function apply2(ctx, config) {
643
+ logger2 = ctx.logger(name2);
699
644
  ctx.model.extend("cafeQuiz", {
700
645
  id: "unsigned",
701
646
  userId: "string",
@@ -704,6 +649,91 @@ async function apply3(ctx, config) {
704
649
  }, { primary: "id", autoInc: true });
705
650
  await downloadQuitDataIfNotExist(ctx, config, config.forceUpdateWhenLoad);
706
651
  ctx.command("轨迹问答", "证明自己是合格的桂皮吧~");
652
+ ctx.command("轨迹问答/新版出题", "测试新版出题功能", { hidden: true }).action(async (argv, _) => {
653
+ await downloadQuitDataIfNotExist(ctx, config, false);
654
+ var lastQuestion = await ctx.cache.get("question", argv.session.userId);
655
+ if (lastQuestion) {
656
+ await argv.session?.send("上一题还没有回答哦~");
657
+ return;
658
+ }
659
+ var dailyNameKey = DailySeededName(argv.session.userId);
660
+ argv.session.user;
661
+ if (quizDataIds == null || quizDataIds.length <= 0) {
662
+ await argv.session?.send(`${At(argv)}超级计算机『卡佩尔』发生核心故障😵(导力网络异常波动)`);
663
+ return;
664
+ }
665
+ var todayCount = await ctx.cache.get("todayCache", dailyNameKey);
666
+ if (!todayCount) {
667
+ todayCount = 0;
668
+ }
669
+ if (todayCount >= config.maxQuizPerDay) {
670
+ await argv.session?.send(`${At(argv)}今日答题已到上限哦~明天再来看看吧❤`);
671
+ return;
672
+ }
673
+ todayCount++;
674
+ var cacheTimeoutTime = CafeTimeTools_default.getRemainingSecondsToBeijingMidnight();
675
+ logger2?.debug(`try set cache ${dailyNameKey}, ${todayCount}`);
676
+ await ctx.cache.set("todayCache", dailyNameKey, todayCount, cacheTimeoutTime * 1e3);
677
+ var randomId = import_koishi4.Random.pick(quizDataIds);
678
+ var qItem = quizDataSet[randomId];
679
+ var qOptions = import_koishi4.Random.shuffle(qItem.options);
680
+ var answerIndex = -1;
681
+ logger2?.info(`${argv.session.userId} get a new quiz(id:${randomId})`);
682
+ for (var i = 0; i < qOptions.length; i++) {
683
+ if (qOptions[i].oid === qItem.a) {
684
+ answerIndex = i;
685
+ break;
686
+ }
687
+ }
688
+ await ctx.cache.set("question", argv.session.userId, { question: randomId, answer: answerIndex }, config.answerTimeout * 1e3);
689
+ var msgQQ = {
690
+ "msg_type": 2,
691
+ "msg_id": `${argv.session.messageId}`,
692
+ "markdown": {
693
+ "template_id": `${qItem.question.img.length > 0 ? config.qqQuizMDImgID : config.qqQuizMDTextID}`,
694
+ "params": [
695
+ {
696
+ "key": "user",
697
+ "values": [`${argv.session.userId}`]
698
+ },
699
+ {
700
+ "key": "question",
701
+ "values": [`${ctx.censor ? "<censor>" : ""}${qItem.question.s}${ctx.censor ? "</censor>" : ""}`]
702
+ },
703
+ {
704
+ "key": "max_time",
705
+ "values": [`${config.answerTimeout}`]
706
+ },
707
+ {
708
+ "key": "answer_a",
709
+ "values": [`${ctx.censor ? "<censor>" : ""}${qOptions[0].s}${ctx.censor ? "</censor>" : ""}`]
710
+ },
711
+ {
712
+ "key": "answer_b",
713
+ "values": [`${ctx.censor ? "<censor>" : ""}${qOptions[1].s}${ctx.censor ? "</censor>" : ""}`]
714
+ },
715
+ {
716
+ "key": "answer_c",
717
+ "values": [`${ctx.censor ? "<censor>" : ""}${qOptions[2].s}${ctx.censor ? "</censor>" : ""}`]
718
+ },
719
+ {
720
+ "key": "answer_d",
721
+ "values": [`${ctx.censor ? "<censor>" : ""}${qOptions[3].s}${ctx.censor ? "</censor>" : ""}`]
722
+ }
723
+ ]
724
+ },
725
+ "keyboard": {
726
+ "id": `${config.qqQuizButtonID}`
727
+ }
728
+ };
729
+ console.log(msgQQ);
730
+ if (argv.session.qq) {
731
+ await argv.session.qq.sendMessage(argv.session.channelId, msgQQ);
732
+ } else {
733
+ await argv.session?.send(JSON.stringify(msgQQ));
734
+ }
735
+ return;
736
+ });
707
737
  ctx.command("轨迹问答/出题", "随机抽一道题目").action(async (argv, _) => {
708
738
  await downloadQuitDataIfNotExist(ctx, config, false);
709
739
  var lastQuestion = await ctx.cache.get("question", argv.session.userId);
@@ -729,9 +759,9 @@ async function apply3(ctx, config) {
729
759
  var cacheTimeoutTime = CafeTimeTools_default.getRemainingSecondsToBeijingMidnight();
730
760
  logger2?.debug(`try set cache ${dailyNameKey}, ${todayCount}`);
731
761
  await ctx.cache.set("todayCache", dailyNameKey, todayCount, cacheTimeoutTime * 1e3);
732
- var randomId = import_koishi6.Random.pick(quizDataIds);
762
+ var randomId = import_koishi4.Random.pick(quizDataIds);
733
763
  var qItem = quizDataSet[randomId];
734
- var qOptions = import_koishi6.Random.shuffle(qItem.options);
764
+ var qOptions = import_koishi4.Random.shuffle(qItem.options);
735
765
  var answerIndex = -1;
736
766
  logger2?.info(`${argv.session.userId} get a new quiz(id:${randomId})`);
737
767
  for (var i = 0; i < qOptions.length; i++) {
@@ -741,11 +771,11 @@ async function apply3(ctx, config) {
741
771
  }
742
772
  }
743
773
  await ctx.cache.set("question", argv.session.userId, { question: randomId, answer: answerIndex }, config.answerTimeout * 1e3);
744
- var messageQuestion = `${qItem.question.img.length > 0 ? `<img src="${qItem.question.img}"/>` : ``}${At(argv)}${qItem.question.s}
774
+ var messageQuestion = `${qItem.question.img.length > 0 ? `<img src="${qItem.question.img}"/>` : ``}${At(argv)}${ctx.censor ? "<censor>" : ""}${qItem.question.s}
745
775
  A. ${qOptions[0].s}
746
- B. ${qOptions[1].s}
776
+ B. ${qOptions[1].s}
747
777
  C. ${qOptions[2].s}
748
- D. ${qOptions[3].s}`;
778
+ D. ${qOptions[3].s}${ctx.censor ? "</censor>" : ""}`;
749
779
  await argv.session?.send(messageQuestion);
750
780
  return;
751
781
  });
@@ -800,6 +830,83 @@ ${comment}`);
800
830
  }
801
831
  });
802
832
  }
833
+ __name(apply2, "apply");
834
+
835
+ // src/cat/index.ts
836
+ var cat_exports = {};
837
+ __export(cat_exports, {
838
+ Config: () => Config3,
839
+ apply: () => apply3,
840
+ inject: () => inject3,
841
+ injectDepend: () => injectDepend3,
842
+ name: () => name3
843
+ });
844
+ var import_koishi6 = require("koishi");
845
+
846
+ // src/cat/config.ts
847
+ var import_koishi5 = require("koishi");
848
+ var CafeBotCatConfig = import_koishi5.Schema.object({
849
+ catName: import_koishi5.Schema.string().description("名称/占位").default("柯贝")
850
+ }).description("猫猫配置");
851
+
852
+ // src/cat/index.ts
853
+ var name3 = "cafe-bot-exp.cat";
854
+ var Config3 = CafeBotCatConfig;
855
+ var injectDepend3 = {
856
+ required: [],
857
+ optional: ["logger"]
858
+ };
859
+ var inject3 = [];
860
+ var catWords = [
861
+ "喵呀呜~ ",
862
+ "喵呀~呵",
863
+ // 走这边。(带路时)
864
+ "喵呀~~噢",
865
+ // 说得没错。就是这样。
866
+ "喵呀~嘎~",
867
+ // 高兴的表现。
868
+ "喵呀~~呵",
869
+ // 稍等一下。(引起注意)
870
+ "喵嘎",
871
+ // 爪子痒痒了。(焦躁不安)
872
+ "喵嘎~~ ",
873
+ // 肚子饿了。
874
+ "喵嘎呜~~",
875
+ // 警戒的表现。
876
+ "喵呜",
877
+ // 困了。乏了。累了。
878
+ "喵呜?",
879
+ // 您是哪位?
880
+ "喵呜—",
881
+ // 是的。
882
+ "喵噢?",
883
+ // 怎么了?
884
+ "喵—噢",
885
+ // 呦,又见面了。 (短期内再会时的招呼)
886
+ "喵—呵",
887
+ // 好久不见了。还好吗?
888
+ "喵~呜",
889
+ // 再见
890
+ "喵~噢",
891
+ // 是,就是这样。(强烈肯定)
892
+ "喵~~呵",
893
+ // 你好。
894
+ "呜咪嘎~ ",
895
+ // 打哈欠。
896
+ "咪呜?",
897
+ // 你说什么?(听到坏话反问的语气)
898
+ "咪~呜 ",
899
+ // 肚子饿了。(幼猫语)
900
+ "咪~~呵"
901
+ // 对不起
902
+ ];
903
+ async function apply3(ctx) {
904
+ ctx.command("黑猫柯贝/摸猫", "摸摸柯贝").action(async (argv, _) => {
905
+ const random = new import_koishi6.Random(() => Math.random());
906
+ let catWord = random.pick(catWords);
907
+ argv.session?.send(`${At(argv)}🐱:${catWord}`);
908
+ });
909
+ }
803
910
  __name(apply3, "apply");
804
911
 
805
912
  // src/config.ts
@@ -817,9 +924,10 @@ var Config4 = import_koishi7.Schema.intersect([
817
924
 
818
925
  // src/index.ts
819
926
  var name4 = "cafe-bot-exp";
820
- var inject3 = {
821
- required: ["http", "cache", "database"],
822
- optional: ["logger"]
927
+ var plugins = [draw_exports, quiz_exports, cat_exports];
928
+ var inject4 = {
929
+ required: Array.from(/* @__PURE__ */ new Set([...injectDepend.required, ...injectDepend2.required, ...injectDepend3.required])),
930
+ optional: Array.from(/* @__PURE__ */ new Set([...injectDepend.optional, ...injectDepend2.optional, ...injectDepend3.optional]))
823
931
  };
824
932
  var logger3 = null;
825
933
  var logoFilePath = null;
@@ -833,10 +941,6 @@ async function apply4(ctx, config) {
833
941
  logoFilePath = path3.join(root, "logo.jpg");
834
942
  logger3?.info(`Try check logoFile ${logoFilePath} or download it, forceUpdate:${config.refreshLogoWhenLoad}`);
835
943
  var result = await downloadTool_default(ctx.http, config.logoUrl, logoFilePath, config.refreshLogoWhenLoad);
836
- var a = "/koishi/data/cafe-bot-exp-data/logo.jpg";
837
- var b = (0, import_url.pathToFileURL)(a);
838
- console.log(b.href);
839
- console.log(await ctx.http.isLocal(b.href));
840
944
  logger3?.info(`download file ${result ? "ok" : "failed"}`);
841
945
  ctx.command("关于", "关于本机器人的信息").action(async (argv, _) => {
842
946
  argv.session?.send(
@@ -855,5 +959,6 @@ __name(apply4, "apply");
855
959
  Config,
856
960
  apply,
857
961
  inject,
858
- name
962
+ name,
963
+ plugins
859
964
  });
@@ -9,5 +9,8 @@ export interface CafeBotQuizConfig {
9
9
  maxQuizPerDay: number;
10
10
  redisServer: string;
11
11
  redisAuth: string;
12
+ qqQuizMDTextID: string;
13
+ qqQuizMDImgID: string;
14
+ qqQuizButtonID: string;
12
15
  }
13
16
  export declare const CafeBotQuizConfig: Schema<CafeBotQuizConfig>;
@@ -4,6 +4,10 @@
4
4
  import { Context, Schema } from 'koishi';
5
5
  import { CafeBotQuizConfig } from './config';
6
6
  export declare const name = "cafe-bot-exp.quiz";
7
+ export declare const injectDepend: {
8
+ required: string[];
9
+ optional: string[];
10
+ };
7
11
  export declare const inject: string[];
8
12
  export interface Config extends CafeBotQuizConfig {
9
13
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@azimiao/koishi-plugin-cafe-bot-exp",
3
3
  "description": "cafe bot experiment",
4
- "version": "0.0.26",
4
+ "version": "0.0.27-beta2",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "repository": {
@@ -35,6 +35,10 @@
35
35
  "http",
36
36
  "cache",
37
37
  "database"
38
+ ],
39
+ "optional": [
40
+ "logger",
41
+ "censor"
38
42
  ]
39
43
  },
40
44
  "locales": [
@@ -43,7 +47,9 @@
43
47
  "preview": true
44
48
  },
45
49
  "dependencies": {
50
+ "@koishijs/censor": "^1.1.0",
51
+ "@koishijs/plugin-adapter-qq": "^4.9.2",
46
52
  "@stdlib/random-base-uniform": "^0.2.1",
47
53
  "fs.promises.exists": "^1.1.4"
48
54
  }
49
- }
55
+ }