koishi-plugin-wordle-game 2.11.0 → 3.0.0

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/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "koishi";
2
- export declare const usage = "## \u4F7F\u7528\n\n\u53D1\u9001 `wordle.\u5F00\u59CB` \u5F00\u5C40\uFF0C\u4E4B\u540E\u76F4\u63A5\u53D1\u9001\u731C\u6D4B\u8BCD\u5373\u53EF\u3002\n\n## \u6307\u4EE4\n\n| \u6307\u4EE4 | \u8BF4\u660E |\n| --- | --- |\n| `wordle.\u5F00\u59CB [\u957F\u5EA6]` | \u5F15\u5BFC\u5F0F\u5F00\u5C40 |\n| `wordle.\u5F00\u59CB.<\u6A21\u5F0F> [\u957F\u5EA6]` | \u6307\u5B9A\u6A21\u5F0F\u5F00\u5C40 |\n| `wordle.\u731C <\u5185\u5BB9>` | \u63D0\u4EA4\u731C\u6D4B |\n| `wordle.\u67E5\u8BE2\u8FDB\u5EA6` | \u67E5\u770B\u5F53\u524D\u5BF9\u5C40\u8FDB\u5EA6 |\n| `wordle.\u7ED3\u675F` | \u7ED3\u675F\u5F53\u524D\u5BF9\u5C40 |\n| `wordle.\u6392\u884C\u699C [\u4EBA\u6570]` | \u67E5\u770B\u6392\u884C\u699C |\n| `wordle.\u67E5\u8BE2\u73A9\u5BB6\u8BB0\u5F55 [@\u67D0\u4EBA]` | \u67E5\u8BE2\u73A9\u5BB6\u6218\u7EE9 |\n| `wordle.\u67E5\u5355\u8BCD <\u8BCD>` | \u5F15\u5BFC\u5F0F\u67E5\u5355\u8BCD |\n| `wordle.\u67E5\u6210\u8BED <\u6210\u8BED>` | \u67E5\u8BE2\u6210\u8BED\u7684\u62FC\u97F3\u4E0E\u89E3\u91CA\uFF08\u6C49\u5178\uFF09 |\n| `wordle.\u62FC\u97F3\u901F\u67E5\u8868` | \u67E5\u770B\u62FC\u97F3\u901F\u67E5\u8868 |\n| `wordle.\u73A9\u6CD5\u4ECB\u7ECD` | \u67E5\u770B\u73A9\u6CD5\u4ECB\u7ECD |\n\n\u6A21\u5F0F\u5305\u62EC\u7ECF\u5178\u3001\u6C49\u515C\u3001\u8BCD\u5F71\u3001Numberle\u3001Math\u3001Lewdle \u53CA\u5176\u4ED6\u8BCD\u5E93\u3002\n\n\u53EF\u7528\u9009\u9879\uFF1A`--hard`\u3001`--uhard`\u3001`--absurd`\u3001`--challenge`\u3001`--wordles`\u3001`--free`\u3001`--all`\u3002";
2
+ export declare const usage = "## \u4F7F\u7528\n\n\u53D1\u9001 `wordle.\u5F00\u59CB` \u5F00\u5C40\uFF0C\u4E4B\u540E\u76F4\u63A5\u53D1\u9001\u731C\u6D4B\u8BCD\u5373\u53EF\u3002\n\n## \u6307\u4EE4\n\n| \u6307\u4EE4 | \u8BF4\u660E |\n| --- | --- |\n| `wordle.\u5F00\u59CB [\u957F\u5EA6]` | \u5F15\u5BFC\u5F0F\u5F00\u5C40 |\n| `wordle.\u5F00\u59CB.<\u6A21\u5F0F> [\u957F\u5EA6]` | \u6307\u5B9A\u6A21\u5F0F\u5F00\u5C40 |\n| `wordle.\u731C <\u5185\u5BB9>` | \u63D0\u4EA4\u731C\u6D4B |\n| `wordle.\u67E5\u8BE2\u8FDB\u5EA6` | \u67E5\u770B\u5F53\u524D\u5BF9\u5C40\u8FDB\u5EA6 |\n| `wordle.\u7ED3\u675F` | \u7ED3\u675F\u5F53\u524D\u5BF9\u5C40 |\n| `wordle.\u6392\u884C\u699C [\u4EBA\u6570]` | \u67E5\u770B\u6392\u884C\u699C |\n| `wordle.\u6218\u7EE9 [@\u67D0\u4EBA]` | \u67E5\u8BE2\u73A9\u5BB6\u6218\u7EE9 |\n| `wordle.\u67E5\u5355\u8BCD <\u8BCD>` | \u5F15\u5BFC\u5F0F\u67E5\u5355\u8BCD |\n| `wordle.\u67E5\u6210\u8BED <\u6210\u8BED>` | \u67E5\u8BE2\u6210\u8BED\u7684\u62FC\u97F3\u4E0E\u89E3\u91CA\uFF08\u6C49\u5178\uFF09 |\n| `wordle.\u62FC\u97F3\u901F\u67E5\u8868` | \u67E5\u770B\u62FC\u97F3\u901F\u67E5\u8868 |\n| `wordle.\u73A9\u6CD5\u4ECB\u7ECD` | \u67E5\u770B\u73A9\u6CD5\u4ECB\u7ECD |\n\n\u6A21\u5F0F\u5305\u62EC\u7ECF\u5178\u3001\u6C49\u515C\u3001\u8BCD\u5F71\u3001Numberle\u3001Math\u3001Lewdle \u53CA\u5176\u4ED6\u8BCD\u5E93\u3002\n\n\u53EF\u7528\u9009\u9879\uFF1A`--hard`\u3001`--uhard`\u3001`--absurd`\u3001`--challenge`\u3001`--wordles`\u3001`--free`\u3001`--all`\u3002";
3
3
  export interface Config {
4
4
  isDarkThemeEnabled: boolean;
5
5
  isHighContrastThemeEnabled: boolean;
package/lib/index.js CHANGED
@@ -56,7 +56,7 @@ var usage = `## 使用
56
56
  | \`wordle.查询进度\` | 查看当前对局进度 |
57
57
  | \`wordle.结束\` | 结束当前对局 |
58
58
  | \`wordle.排行榜 [人数]\` | 查看排行榜 |
59
- | \`wordle.查询玩家记录 [@某人]\` | 查询玩家战绩 |
59
+ | \`wordle.战绩 [@某人]\` | 查询玩家战绩 |
60
60
  | \`wordle.查单词 <词>\` | 引导式查单词 |
61
61
  | \`wordle.查成语 <成语>\` | 查询成语的拼音与解释(汉典) |
62
62
  | \`wordle.拼音速查表\` | 查看拼音速查表 |
@@ -14171,7 +14171,7 @@ ${generateGameEndMessage(gameInfo)}`}${processedResult}
14171
14171
  session,
14172
14172
  `💡 可选模式
14173
14173
  ${exams.map((exam, index) => `${index + 1}. ${exam}`).join("\n")}
14174
- 发送序号或模式名即可开局。`
14174
+ 发送序号或模式名即可开局,或发送「取消」。`
14175
14175
  );
14176
14176
  const userInput = await session.prompt();
14177
14177
  if (!userInput)
@@ -14180,6 +14180,8 @@ ${exams.map((exam, index) => `${index + 1}. ${exam}`).join("\n")}
14180
14180
  session,
14181
14181
  `⏳ 没有等到有效输入,这次先作罢。`
14182
14182
  );
14183
+ if (userInput.trim() === "取消")
14184
+ return await sendMessage(g, session, `✅ 已取消开局。`);
14183
14185
  const selectedExam = isNaN(parseInt(userInput)) ? userInput.toUpperCase().trim() : exams[parseInt(userInput) - 1].toUpperCase();
14184
14186
  const examsInUpperCase = exams.map((exam) => exam.toUpperCase());
14185
14187
  if (examsInUpperCase.includes(selectedExam)) {
@@ -14191,7 +14193,7 @@ ${exams.map((exam, index) => `${index + 1}. ${exam}`).join("\n")}
14191
14193
  `💡 可选长度 ${getValidGuessWordLengthRange(
14192
14194
  selectedExam
14193
14195
  )}
14194
- 发送一个长度即可开局。`
14196
+ 发送一个长度即可开局,或发送「取消」。`
14195
14197
  );
14196
14198
  const userInput2 = await session.prompt();
14197
14199
  if (!userInput2)
@@ -14200,6 +14202,8 @@ ${exams.map((exam, index) => `${index + 1}. ${exam}`).join("\n")}
14200
14202
  session,
14201
14203
  `⏳ 没有等到有效输入,这次先作罢。`
14202
14204
  );
14205
+ if (userInput2.trim() === "取消")
14206
+ return await sendMessage(g, session, `✅ 已取消开局。`);
14203
14207
  guessWordLength = parseInt(userInput2);
14204
14208
  } else {
14205
14209
  guessWordLength = config.defaultWordLengthForGuessing;
@@ -14368,7 +14372,7 @@ ${image}
14368
14372
  `💡 可选长度 ${getValidGuessWordLengthRange(
14369
14373
  exam
14370
14374
  )}
14371
- 发送一个长度即可开局。`
14375
+ 发送一个长度即可开局,或发送「取消」。`
14372
14376
  );
14373
14377
  const userInput = await session.prompt();
14374
14378
  if (!userInput)
@@ -14377,6 +14381,8 @@ ${image}
14377
14381
  session,
14378
14382
  `⏳ 没有等到有效输入,这次先作罢。`
14379
14383
  );
14384
+ if (userInput.trim() === "取消")
14385
+ return await sendMessage(g, session, `✅ 已取消开局。`);
14380
14386
  guessWordLength = parseInt(userInput);
14381
14387
  } else {
14382
14388
  guessWordLength = config.defaultWordLengthForGuessing;
@@ -15298,7 +15304,7 @@ function register3(g) {
15298
15304
  session,
15299
15305
  `💡 可用词库
15300
15306
  ${availableDictionaryArray.map((dictionary, index) => `${index + 1}. ${dictionary}`).join("\n")}
15301
- 发送序号或词库名即可查询。`
15307
+ 发送序号或词库名即可查询,或发送「取消」。`
15302
15308
  );
15303
15309
  const userInput = await session.prompt();
15304
15310
  if (!userInput)
@@ -15307,6 +15313,8 @@ ${availableDictionaryArray.map((dictionary, index) => `${index + 1}. ${dictionar
15307
15313
  session,
15308
15314
  `⏳ 没有等到有效输入,这次先作罢。`
15309
15315
  );
15316
+ if (userInput.trim() === "取消")
15317
+ return await sendMessage(g, session, `✅ 已取消。`);
15310
15318
  const selectedDictionary = isNaN(parseInt(userInput)) ? userInput.toLowerCase().trim() : availableDictionaryArrayToLowerCase[parseInt(userInput) - 1];
15311
15319
  if (availableDictionaryArrayToLowerCase.includes(selectedDictionary)) {
15312
15320
  const command = `wordle.查单词.${selectedDictionary}${targetWord ? ` ${targetWord}` : ""}`;
@@ -15494,7 +15502,7 @@ ${serializedDefinitions ? serializedDefinitions : `• 这个单词的定义暂
15494
15502
  解释 ${idiomInfo.explanation}`
15495
15503
  );
15496
15504
  });
15497
- ctx.command("wordle.查询玩家记录 [targetUser:text]", "查询玩家战绩").action(async ({ session }, targetUser) => {
15505
+ ctx.command("wordle.战绩 [targetUser:text]", "查询玩家战绩").action(async ({ session }, targetUser) => {
15498
15506
  let { userId, username } = session;
15499
15507
  const originalUserId = userId;
15500
15508
  username = await getSessionUserName(g, session);
@@ -15850,11 +15858,13 @@ function register5(g) {
15850
15858
  session,
15851
15859
  `💡 可查看的排行榜
15852
15860
  ${rankType.map((type, index) => `${index + 1}. ${type}`).join("\n")}
15853
- 发送序号或排行榜名即可查看。`
15861
+ 发送序号或排行榜名即可查看,或发送「取消」。`
15854
15862
  );
15855
15863
  const userInput = await session.prompt();
15856
15864
  if (!userInput)
15857
15865
  return sendMessage(g, session, `⏳ 没有等到有效输入,这次先作罢。`);
15866
+ if (userInput.trim() === "取消")
15867
+ return sendMessage(g, session, `✅ 已取消。`);
15858
15868
  const userInputNumber = parseInt(userInput);
15859
15869
  if (!isNaN(userInputNumber) && userInputNumber > 0 && userInputNumber <= rankType.length) {
15860
15870
  const rankName = rankType[userInputNumber - 1];
@@ -15889,11 +15899,13 @@ ${rankType.map((type, index) => `${index + 1}. ${type}`).join("\n")}
15889
15899
  session,
15890
15900
  `💡 可查看的类型
15891
15901
  ${rankType3.map((type2, index) => `${index + 1}. ${type2}`).join("\n")}
15892
- 发送序号或类型名即可查看。`
15902
+ 发送序号或类型名即可查看,或发送「取消」。`
15893
15903
  );
15894
15904
  const userInput = await session.prompt();
15895
15905
  if (!userInput)
15896
15906
  return sendMessage(g, session, `⏳ 没有等到有效输入,这次先作罢。`);
15907
+ if (userInput.trim() === "取消")
15908
+ return sendMessage(g, session, `✅ 已取消。`);
15897
15909
  const userInputNumber = parseInt(userInput);
15898
15910
  if (!isNaN(userInputNumber) && userInputNumber > 0 && userInputNumber <= rankType3.length) {
15899
15911
  const rankName = rankType3[userInputNumber - 1];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-wordle-game",
3
3
  "description": "Koishi 的多模式猜词游戏插件。",
4
- "version": "2.11.0",
4
+ "version": "3.0.0",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [