koishi-plugin-wordle-game 2.4.1 → 2.4.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 +10 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1540,13 +1540,14 @@ ${settlementResult}
|
|
|
1540
1540
|
ctx.command('wordleGame.查询玩家记录 [targetUser:text]', '查询玩家记录')
|
|
1541
1541
|
.action(async ({ session }, targetUser) => {
|
|
1542
1542
|
let { userId, username } = session;
|
|
1543
|
+
const originalUerId = userId;
|
|
1543
1544
|
// 更新玩家记录表中的用户名
|
|
1544
1545
|
username = await getSessionUserName(session);
|
|
1545
1546
|
const sessionUserName = username;
|
|
1546
1547
|
await updateNameInPlayerRecord(session, userId, username);
|
|
1547
|
-
let targetUserRecord;
|
|
1548
|
+
let targetUserRecord = [];
|
|
1548
1549
|
if (!targetUser) {
|
|
1549
|
-
targetUserRecord = await ctx.database.get('wordle_player_records', { userId
|
|
1550
|
+
targetUserRecord = await ctx.database.get('wordle_player_records', { userId });
|
|
1550
1551
|
}
|
|
1551
1552
|
else {
|
|
1552
1553
|
targetUser = await replaceAtTags(session, targetUser);
|
|
@@ -1561,12 +1562,16 @@ ${settlementResult}
|
|
|
1561
1562
|
const match = targetUser.match(userIdRegex);
|
|
1562
1563
|
userId = match?.[1] ?? userId;
|
|
1563
1564
|
username = match?.[2] ?? username;
|
|
1564
|
-
|
|
1565
|
+
if (originalUerId === userId) {
|
|
1566
|
+
targetUserRecord = await ctx.database.get('wordle_player_records', { userId: targetUser });
|
|
1567
|
+
}
|
|
1568
|
+
else {
|
|
1569
|
+
targetUserRecord = await ctx.database.get('wordle_player_records', { userId });
|
|
1570
|
+
}
|
|
1565
1571
|
}
|
|
1566
1572
|
}
|
|
1567
1573
|
if (targetUserRecord.length === 0) {
|
|
1568
|
-
|
|
1569
|
-
return sendMessage(session, `查询对象:${username} 无任何游戏记录。`, `改名 查询玩家记录 开始游戏`, 2);
|
|
1574
|
+
return sendMessage(session, `被查询对象无任何游戏记录。`, `改名 查询玩家记录 开始游戏`, 2);
|
|
1570
1575
|
}
|
|
1571
1576
|
const { win, lose, moneyChange, wordGuessCount, stats, fastestGuessTime } = targetUserRecord[0];
|
|
1572
1577
|
const queryInfo = `【@${sessionUserName}】
|
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/) |... 猜单词|猜成语|猜数字|猜数学方程式|... 的小游戏,支持QQ官方MD模板,且包含多种词库、主题、游戏设置和排行榜系统等。",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.3",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|