koishi-plugin-wordle-game 2.1.4 → 2.1.5

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.
Files changed (2) hide show
  1. package/lib/index.js +12 -0
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1014,6 +1014,10 @@ async function apply(ctx, config) {
1014
1014
  }
1015
1015
  let userInputPinyin = '';
1016
1016
  if (gameMode === '词影') {
1017
+ if (!checkStrokesData(inputWord)) {
1018
+ await setGuessRunningStatus(channelId, false);
1019
+ return await sendMessage(session, `【@${username}】\n不好意思啊...\n我还没学会这个字(`);
1020
+ }
1017
1021
  if (!isIdiomInList(inputWord, idiomsList) && !isFreeMode) {
1018
1022
  const idiomInfo = await getIdiomInfo(inputWord);
1019
1023
  if (idiomInfo.pinyin === '未找到拼音') {
@@ -2710,6 +2714,14 @@ ${content}
2710
2714
  }
2711
2715
  }
2712
2716
  // hs*
2717
+ function checkStrokesData(inputWord) {
2718
+ for (const char of inputWord) {
2719
+ if (!strokesData[char]) {
2720
+ return false;
2721
+ }
2722
+ }
2723
+ return true;
2724
+ }
2713
2725
  async function getSelectedIdiom(randomIdiom) {
2714
2726
  let selectedIdiom = undefined;
2715
2727
  if (isIdiomInList(randomIdiom, idiomsList)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-wordle-game",
3
3
  "description": "欢迎来到 [Wordle](https://www.nytimes.com/games/wordle/index.html) | [汉兜](https://handle.antfu.me/) | [词影](https://cy.surprising.studio/) |... 猜单词|猜成语|猜数字|猜数学方程式|... 的小游戏,包含多种词库、多种主题、多种游戏设置和排行榜系统。",
4
- "version": "2.1.4",
4
+ "version": "2.1.5",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [