koishi-plugin-wordle-game 1.0.2 → 1.0.3

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 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -172,7 +172,13 @@ function apply(ctx, config) {
172
172
  return await sendMessage(session, `【@${username}】\n不好意思你来晚啦~\n游戏已经开始了呢!`);
173
173
  }
174
174
  else {
175
- // 这里返回提示和游戏进程图 db*
175
+ // 这里返回提示和游戏进程图
176
+ // 生成 html 字符串
177
+ const emptyGridHtml = generateEmptyGridHtml(gameInfo.remainingGuessesCount, gameInfo.guessWordLength);
178
+ const styledHtml = generateStyledHtml(gameInfo.guessWordLength + 1);
179
+ // 图
180
+ const imageBuffer = await generateImage(styledHtml, `${gameInfo.wordGuessHtmlCache}\n${emptyGridHtml}`);
181
+ return await sendMessage(session, `【@${username}】\n你已经在游戏里了哦~且游戏正在进行中,加油!\n${koishi_1.h.image(imageBuffer, `image/${config.imageType}`)}`);
176
182
  }
177
183
  }
178
184
  // 判断输入
@@ -429,6 +435,7 @@ function apply(ctx, config) {
429
435
  const letterTilesHtml = '<div class="Row-module_row__pwpBq">' + generateLetterTilesHtml(gameInfo.wordGuess, inputWord) + '</div>';
430
436
  const emptyGridHtml = generateEmptyGridHtml(gameInfo.remainingGuessesCount - 1, gameInfo.guessWordLength);
431
437
  const styledHtml = generateStyledHtml(gameInfo.guessWordLength + 1);
438
+ // 图
432
439
  const imageBuffer = await generateImage(styledHtml, `${gameInfo.wordGuessHtmlCache}${letterTilesHtml}\n${emptyGridHtml}`);
433
440
  // 判断负
434
441
  let isLose = false;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-wordle-game",
3
3
  "description": "欢迎来到 Wordle 猜单词小游戏,包含经典模式、多种词库(CET4、CET6、考研等)模式、多种游戏设置和排行榜系统。",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [