koishi-plugin-mcdle 0.0.3 → 0.0.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 CHANGED
@@ -10,6 +10,7 @@ export interface Config {
10
10
  maxRank: number;
11
11
  dailyPlayLimit: number;
12
12
  retractDelay: number;
13
+ allowRepeatedGuesses: boolean;
13
14
  }
14
15
  export declare const Config: Schema<Config>;
15
16
  declare module "koishi" {
package/lib/index.js CHANGED
@@ -14650,7 +14650,8 @@ var Config = import_koishi.Schema.object({
14650
14650
  dailyPlayLimit: import_koishi.Schema.number().default(1).min(1).description("每日游玩次数上限"),
14651
14651
  retractDelay: import_koishi.Schema.number().min(0).default(0).description(
14652
14652
  `撤回上一条消息的等待时间,单位是秒。值为 0 时不启用自动撤回功能。`
14653
- )
14653
+ ),
14654
+ allowRepeatedGuesses: import_koishi.Schema.boolean().default(false).description("允许重复猜测已猜过的词语(防止撤回时历史不可见)")
14654
14655
  });
14655
14656
  function apply(ctx, cfg) {
14656
14657
  ctx.model.extend(
@@ -14697,7 +14698,7 @@ function apply(ctx, cfg) {
14697
14698
  }
14698
14699
  const content = session.content.trim();
14699
14700
  if (content.length > 10 || /[,。!?;:'"“”‘’【】()《》.,!?;:'"\[\]()<>]/.test(content)) return next();
14700
- if (game.guessedChineseTitles.includes(content)) {
14701
+ if (!cfg.allowRepeatedGuesses && game.guessedChineseTitles.includes(content)) {
14701
14702
  return next();
14702
14703
  }
14703
14704
  let dataSource = [];
@@ -14740,16 +14741,15 @@ function apply(ctx, cfg) {
14740
14741
  }
14741
14742
  __name(mcdle, "mcdle");
14742
14743
  async function ck(session) {
14743
- const platform = session.platform;
14744
- const allContentNodes = [
14745
- (0, import_koishi.h)("message", { userId: session.userId }, `生物词库:
14744
+ if (["red", "onebot"].includes(session.platform)) {
14745
+ const allContentNodes = [
14746
+ (0, import_koishi.h)("message", { userId: session.userId }, `生物词库:
14746
14747
  ${mobChineseTitle.join(" ")}`),
14747
- (0, import_koishi.h)("message", { userId: session.userId }, `方块词库:
14748
+ (0, import_koishi.h)("message", { userId: session.userId }, `方块词库:
14748
14749
  ${blockChineseTitle.join(" ")}`),
14749
- (0, import_koishi.h)("message", { userId: session.userId }, `物品词库:
14750
+ (0, import_koishi.h)("message", { userId: session.userId }, `物品词库:
14750
14751
  ${itemChineseTitle.join(" ")}`)
14751
- ];
14752
- if (["red", "onebot"].includes(platform)) {
14752
+ ];
14753
14753
  try {
14754
14754
  await session.send((0, import_koishi.h)("figure", {}, allContentNodes));
14755
14755
  return;
@@ -14918,7 +14918,7 @@ ${itemChineseTitle.join(" ")}`
14918
14918
  await sendMsg(session, `模式数据异常`);
14919
14919
  return;
14920
14920
  }
14921
- if (record.guessedChineseTitles.includes(guess)) {
14921
+ if (!cfg.allowRepeatedGuesses && record.guessedChineseTitles.includes(guess)) {
14922
14922
  await sendMsg(session, `${guess} 已猜过`);
14923
14923
  return;
14924
14924
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-mcdle",
3
3
  "description": "Koishi 的 Minecraft 猜词游戏插件。根据 Minecraft 物品、生物和方块的属性特征,猜测正确的名称。",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [