koishi-plugin-wordle-game 2.2.8 → 2.2.9

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 +8 -8
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1010,6 +1010,14 @@ async function apply(ctx, config) {
1010
1010
  await setGuessRunningStatus(channelId, false);
1011
1011
  return await sendMessage(session, `【@${username}】\n操作太快了哦~\n再试一次吧!`);
1012
1012
  }
1013
+ // 运行状态
1014
+ await setGuessRunningStatus(channelId, true);
1015
+ // 更新玩家记录表中的用户名
1016
+ await updateNameInPlayerRecord(userId, username);
1017
+ if (!gameInfo.isStarted) {
1018
+ await setGuessRunningStatus(channelId, false);
1019
+ return await sendMessage(session, `【@${username}】\n游戏还没开始呢!`);
1020
+ }
1013
1021
  if (options.random) {
1014
1022
  inputWord = gameInfo.gameMode === '汉兜' || gameInfo.gameMode === '词影' ? getRandomIdiom(idiomsList).idiom : gameInfo.gameMode === 'Numberle' ? generateNumberString(gameInfo.guessWordLength) : gameInfo.gameMode === 'Math' ? getRandomFromStringList(equations[gameInfo.guessWordLength]) : getRandomWordTranslation('ALL', gameInfo.guessWordLength).word;
1015
1023
  }
@@ -1022,14 +1030,6 @@ async function apply(ctx, config) {
1022
1030
  return await sendMessage(session, `【${username}】\n猜测操作已取消!`);
1023
1031
  inputWord = userInput.trim();
1024
1032
  }
1025
- // 运行状态
1026
- await setGuessRunningStatus(channelId, true);
1027
- // 更新玩家记录表中的用户名
1028
- await updateNameInPlayerRecord(userId, username);
1029
- if (!gameInfo.isStarted) {
1030
- await setGuessRunningStatus(channelId, false);
1031
- return await sendMessage(session, `【@${username}】\n游戏还没开始呢!`);
1032
- }
1033
1033
  // 作答时间限制
1034
1034
  const timeDifferenceInSeconds = (timestamp - gameInfo.timestamp) / 1000; // 将时间戳转换为秒
1035
1035
  if (config.enableWordGuessTimeLimit) {
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.2.8",
4
+ "version": "2.2.9",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [