koishi-plugin-wordle-game 1.2.4 → 1.2.6
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
CHANGED
|
@@ -310,7 +310,7 @@ function apply(ctx, config) {
|
|
|
310
310
|
// wordleGame.结束 s* js*
|
|
311
311
|
ctx.command('wordleGame.结束', '结束游戏')
|
|
312
312
|
.action(async ({ session }) => {
|
|
313
|
-
const { channelId, userId, username } = session;
|
|
313
|
+
const { channelId, userId, username, timestamp } = session;
|
|
314
314
|
// 更新玩家记录表中的用户名
|
|
315
315
|
await updateNameInPlayerRecord(userId, username);
|
|
316
316
|
// 游戏状态
|
|
@@ -322,7 +322,7 @@ function apply(ctx, config) {
|
|
|
322
322
|
await updatePlayerRecordsLose(channelId, gameInfo);
|
|
323
323
|
// 结束
|
|
324
324
|
await endGame(channelId);
|
|
325
|
-
return await sendMessage(session, `【@${username}】\n由于您执行了操作:【结束】\n游戏已结束!\n${generateGameEndMessage(gameInfo)}`);
|
|
325
|
+
return await sendMessage(session, `【@${username}】\n由于您执行了操作:【结束】\n游戏已结束!\n${calculateGameDuration(gameInfo.timestamp, timestamp)}\n${generateGameEndMessage(gameInfo)}`);
|
|
326
326
|
// .action
|
|
327
327
|
});
|
|
328
328
|
// wordleGame.开始 s* ks*
|