koishi-plugin-wordle-game 2.4.2 → 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 +7 -4
- 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,10 +1562,12 @@ ${settlementResult}
|
|
|
1561
1562
|
const match = targetUser.match(userIdRegex);
|
|
1562
1563
|
userId = match?.[1] ?? userId;
|
|
1563
1564
|
username = match?.[2] ?? username;
|
|
1564
|
-
|
|
1565
|
-
if (targetUserRecord.length === 0) {
|
|
1565
|
+
if (originalUerId === userId) {
|
|
1566
1566
|
targetUserRecord = await ctx.database.get('wordle_player_records', { userId: targetUser });
|
|
1567
1567
|
}
|
|
1568
|
+
else {
|
|
1569
|
+
targetUserRecord = await ctx.database.get('wordle_player_records', { userId });
|
|
1570
|
+
}
|
|
1568
1571
|
}
|
|
1569
1572
|
}
|
|
1570
1573
|
if (targetUserRecord.length === 0) {
|
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": [
|