@sjtdev/koishi-plugin-dota2tracker 1.3.0 → 1.3.1-beta.1
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 +2 -5
- package/package.json +1 -1
- package/template/rank/rank.ejs +35 -35
package/lib/index.js
CHANGED
|
@@ -1824,7 +1824,7 @@ async function apply(ctx, config) {
|
|
|
1824
1824
|
const players = (await query("PlayersLastmatchRankinfo", {
|
|
1825
1825
|
steamAccountIds: subscribedPlayersSteamIds
|
|
1826
1826
|
})).players;
|
|
1827
|
-
const lastMatches = players.map((player) => player.matches[0]).filter((item, index, self) => index === self.findIndex((t) => t.id === item.id)).filter((match) => import_moment.default.unix(match.startDateTime).isAfter((0, import_moment.default)().subtract(1, "days"))).filter((match) => !pendingMatches.some((pendingMatch) => pendingMatch.matchId == match.id));
|
|
1827
|
+
const lastMatches = players.map((player) => player.matches[0]).filter((match) => match && match.id).filter((item, index, self) => index === self.findIndex((t) => t.id === item.id)).filter((match) => import_moment.default.unix(match.startDateTime).isAfter((0, import_moment.default)().subtract(1, "days"))).filter((match) => !pendingMatches.some((pendingMatch) => pendingMatch.matchId == match.id));
|
|
1828
1828
|
const sendedMatchesIds = [];
|
|
1829
1829
|
for await (const sendedMatchesId of ctx.cache.keys("dt_sended_match_id")) {
|
|
1830
1830
|
sendedMatchesIds.push(Number(sendedMatchesId));
|
|
@@ -1950,10 +1950,7 @@ async function apply(ctx, config) {
|
|
|
1950
1950
|
const img = await generateMatchImage(match, languageTag);
|
|
1951
1951
|
for (let commingGuild of pendingMatch.guilds[languageTag]) {
|
|
1952
1952
|
let broadMatchMessage = pendingMatch.hasMessage ? await generateMatchMessage(match, languageTag, commingGuild) : "";
|
|
1953
|
-
await ctx.broadcast(
|
|
1954
|
-
[`${commingGuild.platform}:${commingGuild.guildId}`],
|
|
1955
|
-
broadMatchMessage + (ctx.config.urlInMessageType.some((type) => type == "match") ? "https://stratz.com/matches/" + match.id : "") + img
|
|
1956
|
-
);
|
|
1953
|
+
await ctx.broadcast([`${commingGuild.platform}:${commingGuild.guildId}`], broadMatchMessage + (ctx.config.urlInMessageType.some((type) => type == "match") ? "https://stratz.com/matches/" + match.id : "") + img);
|
|
1957
1954
|
guildsToLogger.push({
|
|
1958
1955
|
matchId: match.id,
|
|
1959
1956
|
timeout: config.dataParsingTimeoutMinutes,
|
package/package.json
CHANGED
package/template/rank/rank.ejs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
<% const rank = data; %>
|
|
2
|
-
<head>
|
|
3
|
-
<style>
|
|
4
|
-
html,
|
|
5
|
-
body {
|
|
6
|
-
width: 128px;
|
|
7
|
-
height: 128px;
|
|
8
|
-
margin: 0;
|
|
9
|
-
padding: 0;
|
|
10
|
-
background-color: #0000;
|
|
11
|
-
}
|
|
12
|
-
div {
|
|
13
|
-
width: 128px;
|
|
14
|
-
height: 128px;
|
|
15
|
-
position: relative;
|
|
16
|
-
}
|
|
17
|
-
div > * {
|
|
18
|
-
position: absolute;
|
|
19
|
-
width: 100%;
|
|
20
|
-
}
|
|
21
|
-
p {
|
|
22
|
-
margin: 0;
|
|
23
|
-
text-align: center;
|
|
24
|
-
color: #fff;
|
|
25
|
-
bottom: 8px;
|
|
26
|
-
font-size: 20px;
|
|
27
|
-
text-shadow: -2px -2px 0 rgba(0, 0, 0, 0.5), 2px -2px 0 rgba(0, 0, 0, 0.5), -2px 2px 0 rgba(0, 0, 0, 0.5), 2px 2px 0 rgba(0, 0, 0, 0.5); /* 描边效果 */
|
|
28
|
-
}
|
|
29
|
-
</style>
|
|
30
|
-
</head>
|
|
31
|
-
<div>
|
|
32
|
-
<img src="<%= utils.getImageUrl('medal_' + (rank.inTop100 ?? rank.medal)) %>" />
|
|
33
|
-
<img src="<%= utils.getImageUrl("star_" + rank.star) %>" />
|
|
34
|
-
<p><%= rank.leader %></p>
|
|
35
|
-
</div>
|
|
1
|
+
<% const rank = data; %>
|
|
2
|
+
<head>
|
|
3
|
+
<style>
|
|
4
|
+
html,
|
|
5
|
+
body {
|
|
6
|
+
width: 128px;
|
|
7
|
+
height: 128px;
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
background-color: #0000;
|
|
11
|
+
}
|
|
12
|
+
div {
|
|
13
|
+
width: 128px;
|
|
14
|
+
height: 128px;
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
div > * {
|
|
18
|
+
position: absolute;
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
p {
|
|
22
|
+
margin: 0;
|
|
23
|
+
text-align: center;
|
|
24
|
+
color: #fff;
|
|
25
|
+
bottom: 8px;
|
|
26
|
+
font-size: 20px;
|
|
27
|
+
text-shadow: -2px -2px 0 rgba(0, 0, 0, 0.5), 2px -2px 0 rgba(0, 0, 0, 0.5), -2px 2px 0 rgba(0, 0, 0, 0.5), 2px 2px 0 rgba(0, 0, 0, 0.5); /* 描边效果 */
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
30
|
+
</head>
|
|
31
|
+
<div>
|
|
32
|
+
<img src="<%= utils.getImageUrl('medal_' + (rank.inTop100 ?? rank.medal)) %>" />
|
|
33
|
+
<img src="<%= utils.getImageUrl("star_" + rank.star) %>" />
|
|
34
|
+
<p><%= rank.leader %></p>
|
|
35
|
+
</div>
|