koishi-plugin-wordle-game 2.2.4 → 2.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 +8 -6
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1298,7 +1298,7 @@ async function apply(ctx, config) {
|
|
|
1298
1298
|
finalSettlementString = await processNonZeroMoneyPlayers(channelId, platform);
|
|
1299
1299
|
}
|
|
1300
1300
|
// 玩家记录赢
|
|
1301
|
-
await updatePlayerRecordsWin(channelId, gameInfo);
|
|
1301
|
+
await updatePlayerRecordsWin(channelId, gameInfo);
|
|
1302
1302
|
// 增加该玩家猜出单词的次数
|
|
1303
1303
|
const [playerRecord] = await ctx.database.get('wordle_player_records', { userId });
|
|
1304
1304
|
// 更新最快用时
|
|
@@ -1880,7 +1880,7 @@ ${rankType3.map((type, index) => `${index + 1}. ${type}`).join('\n')}
|
|
|
1880
1880
|
if (typeof options.wordles !== 'number' || options.wordles < 1 || options.wordles > 4) {
|
|
1881
1881
|
return await sendMessage(session, `【@${username}】\n词影可查看的多猜测排行榜应在 1 ~ 4 之间!`);
|
|
1882
1882
|
}
|
|
1883
|
-
return await
|
|
1883
|
+
return await getWinCountLeaderboardForCiying(session, options.wordles, `玩家胜场排行榜(词影 x${options.wordles}${options.hard && options.wordles === 1 ? '(困难)' : ''})`, number, options.hard);
|
|
1884
1884
|
}
|
|
1885
1885
|
return await sendMessage(session, await getLeaderboardWinOrLose(type, number, 'win', '胜场'));
|
|
1886
1886
|
});
|
|
@@ -1901,7 +1901,7 @@ ${rankType3.map((type, index) => `${index + 1}. ${type}`).join('\n')}
|
|
|
1901
1901
|
if (typeof options.wordles !== 'number' || options.wordles < 1 || options.wordles > 4) {
|
|
1902
1902
|
return await sendMessage(session, `【@${username}】\n词影可查看的多猜测排行榜应在 1 ~ 4 之间!`);
|
|
1903
1903
|
}
|
|
1904
|
-
return await
|
|
1904
|
+
return await getLoseCountLeaderboardForCiying(session, options.wordles, `玩家输场排行榜(词影 x${options.wordles}${options.hard && options.wordles === 1 ? '(困难)' : ''})`, number, options.hard);
|
|
1905
1905
|
}
|
|
1906
1906
|
return await sendMessage(session, await getLeaderboardWinOrLose(type, number, 'lose', '输场'));
|
|
1907
1907
|
});
|
|
@@ -1927,7 +1927,7 @@ ${rankType3.map((type, index) => `${index + 1}. ${type}`).join('\n')}
|
|
|
1927
1927
|
return await sendMessage(session, await getLeaderboardFastestGuessTime(type, number));
|
|
1928
1928
|
});
|
|
1929
1929
|
});
|
|
1930
|
-
ctx.command('wordleGame.排行榜.词影.猜出次数 [number:number]', '查看玩家猜出次数排行榜(词影)')
|
|
1930
|
+
ctx.command('wordleGame.排行榜.词影.猜出次数 [number:number]', '查看玩家猜出次数排行榜(词影)')
|
|
1931
1931
|
.option('hard', '--hard 查看困难模式', { fallback: false })
|
|
1932
1932
|
.option('wordles', '--wordles <value:number> 查看多猜测模式', { fallback: 1 })
|
|
1933
1933
|
.action(async ({ session, options }, number = config.defaultMaxLeaderboardEntries) => {
|
|
@@ -1983,11 +1983,13 @@ ${rankType3.map((type, index) => `${index + 1}. ${type}`).join('\n')}
|
|
|
1983
1983
|
if (wordlesNum >= 2 && wordlesNum <= 4) {
|
|
1984
1984
|
fastestGuessTimeField = `fastestGuessTimeIn${wordlesNum}Mode`;
|
|
1985
1985
|
}
|
|
1986
|
-
sortedPlayers = getPlayers
|
|
1986
|
+
sortedPlayers = getPlayers
|
|
1987
|
+
.filter(player => player.extraCiyingRankInfo[fastestGuessTimeField] > 0)
|
|
1988
|
+
.sort((a, b) => a.extraCiyingRankInfo[fastestGuessTimeField] - b.extraCiyingRankInfo[fastestGuessTimeField]);
|
|
1987
1989
|
const topPlayers = sortedPlayers.slice(0, number);
|
|
1988
1990
|
result = `${title}:\n`;
|
|
1989
1991
|
topPlayers.forEach((player, index) => {
|
|
1990
|
-
result += `${index + 1}. ${player.username}:${player.extraCiyingRankInfo[fastestGuessTimeField]}
|
|
1992
|
+
result += `${index + 1}. ${player.username}:${formatGameDuration2(player.extraCiyingRankInfo[fastestGuessTimeField])}\n`;
|
|
1991
1993
|
});
|
|
1992
1994
|
return await sendMessage(session, result);
|
|
1993
1995
|
}
|
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/) |... 猜单词|猜成语|猜数字|猜数学方程式|... 的小游戏,包含多种词库、多种主题、多种游戏设置和排行榜系统。",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.6",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|