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.
- package/lib/index.js +8 -1
- 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
|
-
// 这里返回提示和游戏进程图
|
|
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;
|