@sjtdev/koishi-plugin-dota2tracker 1.1.8-beta.1 → 1.1.8
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 +5 -7
- package/package.json +2 -2
- package/template/match/match_2.ejs +73 -2
package/lib/index.js
CHANGED
|
@@ -1124,7 +1124,7 @@ var ejs = __toESM(require("ejs"));
|
|
|
1124
1124
|
var name = "dota2tracker";
|
|
1125
1125
|
var usage = `
|
|
1126
1126
|
DOTA2Bot插件-提供自动追踪群友的最新对局的功能(需群友绑定),以及一系列查询功能。
|
|
1127
|
-
|
|
1127
|
+
**更多信息请进入[插件主页](https://github.com/sjtdev/koishi-plugin-dota2tracker)与[更新日志](https://github.com/sjtdev/koishi-plugin-dota2tracker/blob/master/changelog.md)查看。**`;
|
|
1128
1128
|
var inject = ["http", "database", "cron", "puppeteer"];
|
|
1129
1129
|
var Config = import_koishi.Schema.intersect([
|
|
1130
1130
|
import_koishi.Schema.object({
|
|
@@ -1678,12 +1678,10 @@ async function apply(ctx, config) {
|
|
|
1678
1678
|
const subscribedGuilds = await ctx.database.get("dt_subscribed_guilds", void 0);
|
|
1679
1679
|
const subscribedPlayersInGuild = (await ctx.database.get("dt_subscribed_players", void 0)).filter((player) => subscribedGuilds.some((guild) => guild.guildId == player.guildId));
|
|
1680
1680
|
if (subscribedPlayersInGuild.length > 0) {
|
|
1681
|
-
const subscribedPlayersSteamIds =
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
);
|
|
1686
|
-
const lastMatches = (await query(subscribedPlayersSteamIds)).data.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));
|
|
1681
|
+
const subscribedPlayersSteamIds = subscribedPlayersInGuild.map((player) => player.steamId).filter(function(value, index, self) {
|
|
1682
|
+
return self.indexOf(value) === index;
|
|
1683
|
+
});
|
|
1684
|
+
const lastMatches = (await query(PLAYERS_LASTMATCH(subscribedPlayersSteamIds))).data.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));
|
|
1687
1685
|
const sendedMatchesIds = (await ctx.database.get("dt_sended_match_id", { matchId: lastMatches.map((match) => match.id) }, ["matchId"])).map((match) => match.matchId);
|
|
1688
1686
|
lastMatches.filter((match) => !sendedMatchesIds.includes(match.id)).forEach((match) => {
|
|
1689
1687
|
const tempGuilds = [];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjtdev/koishi-plugin-dota2tracker",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "1.1.8
|
|
4
|
+
"version": "1.1.8",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dota2"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"dotaconstants": "^8.
|
|
29
|
+
"dotaconstants": "^8.7.0",
|
|
30
30
|
"ejs": "^3.1.10",
|
|
31
31
|
"moment": "^2.30.1"
|
|
32
32
|
},
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
grid-column: 1;
|
|
141
141
|
position: relative;
|
|
142
142
|
}
|
|
143
|
-
.player > .hero_avatar >
|
|
143
|
+
.player > .hero_avatar > .level {
|
|
144
144
|
width: 20px;
|
|
145
145
|
height: 15px;
|
|
146
146
|
background-color: #323232;
|
|
@@ -153,6 +153,72 @@
|
|
|
153
153
|
text-align: center;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
.player > .hero_avatar > .party_line {
|
|
157
|
+
position: absolute;
|
|
158
|
+
height: 100%;
|
|
159
|
+
top: 0;
|
|
160
|
+
width: 3px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.player > .hero_avatar > .party_mark {
|
|
164
|
+
position: absolute;
|
|
165
|
+
line-height: 1.5;
|
|
166
|
+
text-align: center;
|
|
167
|
+
width: 16px;
|
|
168
|
+
font-size: 10px;
|
|
169
|
+
top: 2px;
|
|
170
|
+
left: 5px;
|
|
171
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.player > .hero_avatar.party_I > .party_line {
|
|
175
|
+
background-color: #caffe5;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.player > .hero_avatar.party_I > .party_mark {
|
|
179
|
+
color: #caffe5;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.player > .hero_avatar.party_I > .party_mark::after {
|
|
183
|
+
content: "I";
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.player > .hero_avatar.party_II > .party_line {
|
|
187
|
+
background-color: #ffe484;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.player > .hero_avatar.party_II > .party_mark {
|
|
191
|
+
color: #ffe484;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.player > .hero_avatar.party_II > .party_mark::after {
|
|
195
|
+
content: "II";
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.player > .hero_avatar.party_III > .party_line {
|
|
199
|
+
background-color: #e19be2;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.player > .hero_avatar.party_III > .party_mark {
|
|
203
|
+
color: #e19be2;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.player > .hero_avatar.party_III > .party_mark::after {
|
|
207
|
+
content: "III";
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.player > .hero_avatar.party_IV > .party_line {
|
|
211
|
+
background-color: #ccdaf4;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.player > .hero_avatar.party_IV > .party_mark {
|
|
215
|
+
color: #ccdaf4;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.player > .hero_avatar.party_IV > .party_mark::after {
|
|
219
|
+
content: "IV";
|
|
220
|
+
}
|
|
221
|
+
|
|
156
222
|
.player > .rank {
|
|
157
223
|
position: relative;
|
|
158
224
|
grid-row: 1 / span 3;
|
|
@@ -182,6 +248,9 @@
|
|
|
182
248
|
.player > .player_name {
|
|
183
249
|
grid-row: 1;
|
|
184
250
|
grid-column: 3 / span 2;
|
|
251
|
+
white-space: nowrap; /* 禁止换行 */
|
|
252
|
+
overflow: hidden; /* 隐藏溢出部分 */
|
|
253
|
+
text-overflow: ellipsis; /* 用省略号表示溢出的文本 */
|
|
185
254
|
}
|
|
186
255
|
.player > .player_name > .rank {
|
|
187
256
|
color: #aaa;
|
|
@@ -373,9 +442,11 @@
|
|
|
373
442
|
%>
|
|
374
443
|
<%- match.players.map(player=> `
|
|
375
444
|
<div class="player ${player.team}${player.hero.id==80?" bear":""}" style="order: ${player.team==="radiant"?1:100};">
|
|
376
|
-
<div class="hero_avatar row-1">
|
|
445
|
+
<div class="hero_avatar row-1${player.partyId != null ? " party_" + match.party[player.partyId] : ""}">
|
|
377
446
|
<img src="${utils.getImageUrl(player.hero.shortName, ImageType.Heroes)}" />
|
|
378
447
|
<p class="level">${player.level}</p>
|
|
448
|
+
<p class="party_line"></p>
|
|
449
|
+
<p class="party_mark"></p>
|
|
379
450
|
</div>
|
|
380
451
|
<div class="rank">
|
|
381
452
|
<img
|