mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
Compare commits
610
Commits
v1.26.1
...
ue-archive-4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8478930f2e | ||
|
|
54c7b6b476 | ||
|
|
6a74451740 | ||
|
|
7bdaf9ca93 | ||
|
|
60025365c4 | ||
|
|
1e7acc2775 | ||
|
|
af13e3f184 | ||
|
|
19a2492555 | ||
|
|
3c51f4f94a | ||
|
|
8f9e537a5e | ||
|
|
9368d058f2 | ||
|
|
31b628049a | ||
|
|
072e913433 | ||
|
|
e3f131cdfd | ||
|
|
5cab394ced | ||
|
|
2033fab21a | ||
|
|
7471567147 | ||
|
|
43aee373ea | ||
|
|
993083665b | ||
|
|
f2c25424d9 | ||
|
|
bbe53deb98 | ||
|
|
1f07c2be74 | ||
|
|
ea744b673a | ||
|
|
d8a6cac52f | ||
|
|
1524b9a35d | ||
|
|
36738f57a9 | ||
|
|
fca6cb23d1 | ||
|
|
a704b291fd | ||
|
|
e1b5b21fae | ||
|
|
097f2792ae | ||
|
|
089d0e9682 | ||
|
|
6a92b3ae80 | ||
|
|
1e91065033 | ||
|
|
b20bb97ea3 | ||
|
|
ba97a9f28b | ||
|
|
81e480f983 | ||
|
|
40e4e0a274 | ||
|
|
83b7de77de | ||
|
|
20f7119854 | ||
|
|
275ddcc7a6 | ||
|
|
4858f31da4 | ||
|
|
4bc255a624 | ||
|
|
17755641a1 | ||
|
|
0e6b0087ce | ||
|
|
fcd084a86f | ||
|
|
af699ff5b7 | ||
|
|
93665df223 | ||
|
|
f8b4f9372a | ||
|
|
e84e15daf4 | ||
|
|
d7af7e19dd | ||
|
|
c5cf172e42 | ||
|
|
2e8cac885c | ||
|
|
9ed4a856bf | ||
|
|
eedd4b3f27 | ||
|
|
3b7fe0b114 | ||
|
|
a6d66b94f5 | ||
|
|
c7a7bbb809 | ||
|
|
02ce6ba8d9 | ||
|
|
9dd057d594 | ||
|
|
64ec981496 | ||
|
|
8afafdeece | ||
|
|
6b9fd1d392 | ||
|
|
c1efc50134 | ||
|
|
b4b1f4e916 | ||
|
|
3de0c40ce3 | ||
|
|
893bfa8393 | ||
|
|
cc25535c34 | ||
|
|
a4cdf16fcd | ||
|
|
36588b11e6 | ||
|
|
e927838c14 | ||
|
|
5197ebb6a7 | ||
|
|
51089a3e91 | ||
|
|
c6121fd4bd | ||
|
|
09f5d4e3f7 | ||
|
|
0365656a0e | ||
|
|
90a46eeffa | ||
|
|
1249877a8c | ||
|
|
02df1e59d8 | ||
|
|
edce64c1bd | ||
|
|
74b821ac13 | ||
|
|
a5a72f9536 | ||
|
|
fe3d029e74 | ||
|
|
a69ea38947 | ||
|
|
7dca9d3244 | ||
|
|
bc9f7054e1 | ||
|
|
abebfcf6c6 | ||
|
|
470869418c | ||
|
|
cd2bad3b27 | ||
|
|
53c2f9605f | ||
|
|
5e9555aa57 | ||
|
|
084d55b853 | ||
|
|
a3879f3fa7 | ||
|
|
135a2d74c4 | ||
|
|
233f866c9e | ||
|
|
9e880ff24f | ||
|
|
36039563e0 | ||
|
|
022e970537 | ||
|
|
51e99ec442 | ||
|
|
95f67a04d7 | ||
|
|
caeba34ba1 | ||
|
|
1e6ee2b80d | ||
|
|
6d6a634973 | ||
|
|
6a21c9aaac | ||
|
|
55e6599eaa | ||
|
|
e146366385 | ||
|
|
7e11c1e5ce | ||
|
|
2dc4f12246 | ||
|
|
354aca5057 | ||
|
|
c5f156eecc | ||
|
|
37b89d1f2d | ||
|
|
74c358dde5 | ||
|
|
4362746de3 | ||
|
|
d5d97e772a | ||
|
|
654c87dae7 | ||
|
|
e94f8a7cd2 | ||
|
|
d39ffecb3b | ||
|
|
6f8e12657c | ||
|
|
4a79f98f3f | ||
|
|
06de86c5a6 | ||
|
|
37ba6d37d4 | ||
|
|
636add3a18 | ||
|
|
2e13bcfee2 | ||
|
|
af53713c60 | ||
|
|
c37820d2cd | ||
|
|
d51b6bdd18 | ||
|
|
67ce4815df | ||
|
|
8c14c3d093 | ||
|
|
8373fb1b7a | ||
|
|
3aafe4d9f1 | ||
|
|
2c2c3687c7 | ||
|
|
9375f134db | ||
|
|
1eca71d28c | ||
|
|
9bf1554c30 | ||
|
|
f48c5d246d | ||
|
|
5e9aa99755 | ||
|
|
e7386ff766 | ||
|
|
4129a1964f | ||
|
|
64d12bba8b | ||
|
|
69b13fd33a | ||
|
|
b1dd319c1e | ||
|
|
bc6bb4f10e | ||
|
|
5adf90bab2 | ||
|
|
bc8cfc9897 | ||
|
|
9037e2caff | ||
|
|
e7ca8f1b10 | ||
|
|
0d8a677ac5 | ||
|
|
a8dc271e0a | ||
|
|
f3d6ba68a7 | ||
|
|
e68b27bac4 | ||
|
|
d49eef7308 | ||
|
|
6e630a91aa | ||
|
|
2c66e79daf | ||
|
|
9a94a4e371 | ||
|
|
b1372c998d | ||
|
|
4ed93cb38f | ||
|
|
4d1b175c07 | ||
|
|
ecfedc32ad | ||
|
|
9da514c329 | ||
|
|
ee5386c925 | ||
|
|
1a90e9312d | ||
|
|
2c7082fe04 | ||
|
|
518a83ee73 | ||
|
|
25c40bcea2 | ||
|
|
f88ac8daf7 | ||
|
|
c4be6b78b6 | ||
|
|
2cfc65a990 | ||
|
|
a8eb751048 | ||
|
|
f030fd53b1 | ||
|
|
da506083c9 | ||
|
|
8bdc4d9b1b | ||
|
|
e0718d9ebb | ||
|
|
dbf1718d39 | ||
|
|
84dd13c0ac | ||
|
|
fdecef5f9c | ||
|
|
198e800958 | ||
|
|
29bb8ada06 | ||
|
|
662f116afe | ||
|
|
02f0c078a5 | ||
|
|
4dd1113b6d | ||
|
|
e656b83719 | ||
|
|
b90b355f8f | ||
|
|
165a9cd719 | ||
|
|
5b8da36fb8 | ||
|
|
bbe682fa73 | ||
|
|
af08df1526 | ||
|
|
47a60adac7 | ||
|
|
10f3bc0026 | ||
|
|
e7da1d582f | ||
|
|
df70816f7e | ||
|
|
091364d7f3 | ||
|
|
753c06eee8 | ||
|
|
17713243b5 | ||
|
|
4e4f070368 | ||
|
|
4064f163ec | ||
|
|
b911f64847 | ||
|
|
b86b6e09d0 | ||
|
|
d2e7a477bb | ||
|
|
f9c182e68c | ||
|
|
7c497ab681 | ||
|
|
c840086c11 | ||
|
|
8649d09a94 | ||
|
|
c764564a96 | ||
|
|
ad8cbb96b7 | ||
|
|
b409e26ca5 | ||
|
|
fbbfa5307c | ||
|
|
4165533838 | ||
|
|
fb47ab3e64 | ||
|
|
57971453ad | ||
|
|
c8cb490b48 | ||
|
|
232f24181f | ||
|
|
46441d74d8 | ||
|
|
a2274a6f0c | ||
|
|
0eb2827e7b | ||
|
|
41cb3f8511 | ||
|
|
9405dccee9 | ||
|
|
83b0c6abc3 | ||
|
|
bf1621001b | ||
|
|
8a5a4bf696 | ||
|
|
a99cce07dc | ||
|
|
d8c26ba24a | ||
|
|
f0b393c48f | ||
|
|
d0d205bb93 | ||
|
|
aeaf52d3ac | ||
|
|
e05358952a | ||
|
|
c1000e1608 | ||
|
|
46c86c5352 | ||
|
|
507b503560 | ||
|
|
37ca981d33 | ||
|
|
efe6d2b1a5 | ||
|
|
9f79f9c1e8 | ||
|
|
38b4c62777 | ||
|
|
df1bc56a4c | ||
|
|
c3d2b063bc | ||
|
|
1b94748668 | ||
|
|
f4f804727f | ||
|
|
3729072594 | ||
|
|
c174f32e15 | ||
|
|
2443ecde2f | ||
|
|
9c027b3dde | ||
|
|
22d794ac65 | ||
|
|
35073c184e | ||
|
|
4741406e4a | ||
|
|
24107433c6 | ||
|
|
05c6fcfb34 | ||
|
|
be7a16d399 | ||
|
|
c7f781dbb2 | ||
|
|
a66c6ebb27 | ||
|
|
83aeca2e5e | ||
|
|
89a3db05d8 | ||
|
|
6050145b16 | ||
|
|
77c78741b3 | ||
|
|
f35670d6a8 | ||
|
|
3392a57480 | ||
|
|
ed64ee8228 | ||
|
|
4f47d6ce85 | ||
|
|
92d56ac086 | ||
|
|
671b8b60b9 | ||
|
|
ba5a5245d9 | ||
|
|
eee262add7 | ||
|
|
e5eaf3fd75 | ||
|
|
5fdc9044ca | ||
|
|
0924a77776 | ||
|
|
1a46e176f5 | ||
|
|
efb8df9769 | ||
|
|
04e09b84ff | ||
|
|
b52c107af9 | ||
|
|
c5e6f5e2eb | ||
|
|
365c68aa4d | ||
|
|
ff9ec55da6 | ||
|
|
2a2994ae69 | ||
|
|
e3c6497d29 | ||
|
|
bdc013b4c8 | ||
|
|
e20d65d218 | ||
|
|
8b726c12d9 | ||
|
|
da704e6181 | ||
|
|
64d346ccb6 | ||
|
|
c090ad6492 | ||
|
|
8b6610151e | ||
|
|
545b655d4e | ||
|
|
0e6aa734cb | ||
|
|
2bef96475c | ||
|
|
45938c875f | ||
|
|
9d916a588d | ||
|
|
f0295079cc | ||
|
|
6d8387fa9d | ||
|
|
7a18de6650 | ||
|
|
cc6c4faa2d | ||
|
|
4253cd3e1b | ||
|
|
75cf827082 | ||
|
|
73c8807f14 | ||
|
|
9fac6dd40d | ||
|
|
c06c338536 | ||
|
|
9258623931 | ||
|
|
3b02c25973 | ||
|
|
f90768d155 | ||
|
|
d77bd6a5f9 | ||
|
|
6836cb327f | ||
|
|
4373efd0cd | ||
|
|
f13165e77d | ||
|
|
8a5b0c1170 | ||
|
|
f16511a72e | ||
|
|
76f7ae45ce | ||
|
|
ad2aaa7bf8 | ||
|
|
2a4375c718 | ||
|
|
df0dc4f118 | ||
|
|
92399de5e2 | ||
|
|
8d9dff8d73 | ||
|
|
f91744f2f0 | ||
|
|
e946dfdb69 | ||
|
|
6283ddc57a | ||
|
|
2d66e0ab28 | ||
|
|
c3d8f15a2a | ||
|
|
21a37ec6cc | ||
|
|
de471400ad | ||
|
|
0b16295853 | ||
|
|
63eea81856 | ||
|
|
ba57d61af5 | ||
|
|
3d940f4b47 | ||
|
|
8ef355c574 | ||
|
|
71e1ab1362 | ||
|
|
53dc108356 | ||
|
|
57b3218c5a | ||
|
|
7472e39faf | ||
|
|
034417d19f | ||
|
|
0368e9ceda | ||
|
|
28f365f762 | ||
|
|
40a81f6b1b | ||
|
|
9475d22472 | ||
|
|
9538a03afb | ||
|
|
d5d171bea6 | ||
|
|
a9c9a90ac1 | ||
|
|
f7c562f8b6 | ||
|
|
836cf69f01 | ||
|
|
ba17aae706 | ||
|
|
30ca5c053a | ||
|
|
c36419f5b6 | ||
|
|
1879895db2 | ||
|
|
c964e3c8ec | ||
|
|
2ef6d18f82 | ||
|
|
10b672572b | ||
|
|
2a4efa8cd2 | ||
|
|
5a8435da29 | ||
|
|
3461349a96 | ||
|
|
3791e9df12 | ||
|
|
b3c36aac93 | ||
|
|
c0895409bc | ||
|
|
438b565cbb | ||
|
|
cf1a82e89b | ||
|
|
0506e361b2 | ||
|
|
d6a1357a82 | ||
|
|
a5a1dbd51b | ||
|
|
5201350e44 | ||
|
|
6a84b9d5ae | ||
|
|
cf04fe21b3 | ||
|
|
84eb3c2da3 | ||
|
|
22bf2dc1d8 | ||
|
|
b9c339daa7 | ||
|
|
ef3006cac1 | ||
|
|
e482fd40c1 | ||
|
|
cc4569966e | ||
|
|
3708a3ced7 | ||
|
|
0ae59c2fd7 | ||
|
|
7027f63236 | ||
|
|
6725e79021 | ||
|
|
5ca3cee9da | ||
|
|
602a5a1e99 | ||
|
|
bfbf3bdc39 | ||
|
|
644686582e | ||
|
|
1c00bc81f8 | ||
|
|
ac3b69bec5 | ||
|
|
3e14c943b6 | ||
|
|
d33633be2c | ||
|
|
4bf70d02d0 | ||
|
|
377bcf0e38 | ||
|
|
884b6d4318 | ||
|
|
ee94d762d0 | ||
|
|
bcde319ac1 | ||
|
|
a4828774ca | ||
|
|
e59725d763 | ||
|
|
a62179a853 | ||
|
|
38ba940a98 | ||
|
|
a07d6c775e | ||
|
|
f9f7468544 | ||
|
|
98724df711 | ||
|
|
5499cb5cca | ||
|
|
122b3f6478 | ||
|
|
d2b24fc953 | ||
|
|
bb557a7dd7 | ||
|
|
f1612e8fe3 | ||
|
|
d12f4fb00e | ||
|
|
ad555ece9a | ||
|
|
9aee8feaf4 | ||
|
|
baa16840df | ||
|
|
4e80490fd4 | ||
|
|
6233c16b88 | ||
|
|
c4f1d9f3b0 | ||
|
|
2c365cdea0 | ||
|
|
18afa4cd28 | ||
|
|
ef9778ea96 | ||
|
|
d8459d373c | ||
|
|
7900c61a9b | ||
|
|
ceb7842d49 | ||
|
|
e0c897025e | ||
|
|
ade6ec8af1 | ||
|
|
06cbe1e733 | ||
|
|
cb3e759f75 | ||
|
|
e4558d978c | ||
|
|
260d819c77 | ||
|
|
ffe58de179 | ||
|
|
6fbe1d6339 | ||
|
|
835d03d12c | ||
|
|
2b208fa6a0 | ||
|
|
66d63d5c60 | ||
|
|
134566f1d8 | ||
|
|
d592a95cae | ||
|
|
4f74556eb6 | ||
|
|
1342f434a3 | ||
|
|
6110471990 | ||
|
|
359eec5209 | ||
|
|
6ccffa0458 | ||
|
|
4c0c10e39e | ||
|
|
3d41c56c73 | ||
|
|
e0dda567f4 | ||
|
|
91b367cd70 | ||
|
|
5a65fee1d1 | ||
|
|
c7856364ad | ||
|
|
65899a06c4 | ||
|
|
571ae81306 | ||
|
|
6b2dda0f9d | ||
|
|
9de41529d1 | ||
|
|
7dfdf4c11b | ||
|
|
db4132f666 | ||
|
|
d9688f6051 | ||
|
|
12e89a6b65 | ||
|
|
2d524cd273 | ||
|
|
1d44ecab18 | ||
|
|
bf9addf589 | ||
|
|
4deee2d709 | ||
|
|
309fda1ed1 | ||
|
|
d6e7f35214 | ||
|
|
7cd9131b60 | ||
|
|
599b81934e | ||
|
|
3f595d0d8a | ||
|
|
9afed23bb8 | ||
|
|
fc869f8b45 | ||
|
|
cf7ba1c6b5 | ||
|
|
07ca41e82a | ||
|
|
c487d9af61 | ||
|
|
9be6725043 | ||
|
|
e0daf85561 | ||
|
|
8203db3dc2 | ||
|
|
eb5527706e | ||
|
|
1f577c2317 | ||
|
|
68362c22b1 | ||
|
|
844965bcb0 | ||
|
|
1843eb3bcf | ||
|
|
60ab845326 | ||
|
|
3bbc083b2a | ||
|
|
8df159b182 | ||
|
|
c7238b0342 | ||
|
|
ba6006a320 | ||
|
|
43b9252f21 | ||
|
|
d727ceaaf6 | ||
|
|
eb95230a5f | ||
|
|
b6fd5eaa66 | ||
|
|
117f9892d6 | ||
|
|
c20caf45a2 | ||
|
|
670b678348 | ||
|
|
b1f0d4d844 | ||
|
|
e9d1c82a60 | ||
|
|
cc4345f1a3 | ||
|
|
6d8326861b | ||
|
|
8517ecfdb6 | ||
|
|
a38b5d7ddd | ||
|
|
f726793819 | ||
|
|
19531aa9ae | ||
|
|
6d6bae847b | ||
|
|
cc70b3ccc3 | ||
|
|
e3bf619808 | ||
|
|
f6cb4f2518 | ||
|
|
f396d6c4a1 | ||
|
|
768c420ae4 | ||
|
|
7fba197bef | ||
|
|
b074481e1a | ||
|
|
987e35ef8f | ||
|
|
83c77b5945 | ||
|
|
e4f0120d67 | ||
|
|
2055c00154 | ||
|
|
c814230dcb | ||
|
|
2f31aadb29 | ||
|
|
3113bf3a47 | ||
|
|
70bd54e03b | ||
|
|
8863ac5fde | ||
|
|
b62009ce2b | ||
|
|
0f3d230f42 | ||
|
|
9db6b997c3 | ||
|
|
d9fcbd028b | ||
|
|
db74058075 | ||
|
|
4180736d37 | ||
|
|
382f04229e | ||
|
|
3c9ba9ec53 | ||
|
|
4848234264 | ||
|
|
2ad0fcfdf9 | ||
|
|
8f0894364b | ||
|
|
3695b8f7f4 | ||
|
|
4f8c1d416f | ||
|
|
453286677a | ||
|
|
53a49f199a | ||
|
|
fdfde46342 | ||
|
|
1d836b2053 | ||
|
|
6d448dc5c4 | ||
|
|
75d4d60b30 | ||
|
|
e7f47fd2fd | ||
|
|
50a3d1e922 | ||
|
|
e296267ccd | ||
|
|
d9aca6a3ed | ||
|
|
d07a6e954e | ||
|
|
6bcaf685f8 | ||
|
|
066f17a2f3 | ||
|
|
374d6c22f9 | ||
|
|
55927258ca | ||
|
|
bb99220497 | ||
|
|
4f6b41e264 | ||
|
|
f9c4cee30c | ||
|
|
d865043b34 | ||
|
|
a4080f21b9 | ||
|
|
853c520d8a | ||
|
|
d78f8c6ec4 | ||
|
|
318a71bd32 | ||
|
|
2458d2c80c | ||
|
|
37a72e3bb5 | ||
|
|
bc9c9ad4e7 | ||
|
|
b38c732983 | ||
|
|
415861f6e8 | ||
|
|
3124afa253 | ||
|
|
8523b9f44f | ||
|
|
71e0404890 | ||
|
|
c01fd1f4ff | ||
|
|
905ba59f4e | ||
|
|
33eea3f261 | ||
|
|
2237d460bb | ||
|
|
12e7d664e5 | ||
|
|
9e4bdcd458 | ||
|
|
03ec44c765 | ||
|
|
d9f6acea2d | ||
|
|
5b5e204cce | ||
|
|
60b2e62713 | ||
|
|
5e7620ccf4 | ||
|
|
c3a83abe5d | ||
|
|
73cb3873d9 | ||
|
|
3b429a6c05 | ||
|
|
76fe6b5e20 | ||
|
|
5c8af447b6 | ||
|
|
5a805b1cec | ||
|
|
326ae548b6 | ||
|
|
3a2e75ab02 | ||
|
|
b4f8340f49 | ||
|
|
5e0d0a3d6d | ||
|
|
4122ff5bf1 | ||
|
|
d937f62ac1 | ||
|
|
b4f0a9f1b9 | ||
|
|
68535149e3 | ||
|
|
2419934638 | ||
|
|
c0076e9ef9 | ||
|
|
1cd7438d5d | ||
|
|
ab798b722f | ||
|
|
66a54a9996 | ||
|
|
fdcbb8f29f | ||
|
|
5ab0a12f4c | ||
|
|
d19d4e0e26 | ||
|
|
2f9791d34c | ||
|
|
cd53136dce | ||
|
|
2eadad8612 | ||
|
|
2fe3c50bef | ||
|
|
10c7e4a19d | ||
|
|
143c84f52f | ||
|
|
0c54905384 | ||
|
|
437c5e0f57 | ||
|
|
b4e4702415 | ||
|
|
4b8a154142 | ||
|
|
31a61c8a6b | ||
|
|
631af6205e | ||
|
|
6667e548b2 | ||
|
|
67f9147aac | ||
|
|
20f54a39d6 | ||
|
|
26d3bdaac7 | ||
|
|
74ac5b5ac2 | ||
|
|
7188014fbb | ||
|
|
c039862c56 | ||
|
|
3d6d18267d | ||
|
|
dced738055 | ||
|
|
e5ddbc7297 | ||
|
|
7f9a54ef85 | ||
|
|
65c52c2e82 | ||
|
|
5a34a35638 | ||
|
|
1281503de9 | ||
|
|
7a3bdd8f35 | ||
|
|
d7e556e136 | ||
|
|
0997e2b089 | ||
|
|
33c0fbbb9b | ||
|
|
bef33659e5 | ||
|
|
ede1c90f10 | ||
|
|
4218626cbf | ||
|
|
08eed5ce31 | ||
|
|
00e89cff55 | ||
|
|
cda83639b2 | ||
|
|
e4e1903a2a | ||
|
|
a5df2528f6 | ||
|
|
74c0740941 | ||
|
|
74e85f82f1 |
No files matched your search
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"indentSize": 2
|
||||||
|
}
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
name: Build Assets
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: main
|
|
||||||
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
cdn_branch:
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
default: main
|
|
||||||
description: What CDN branch to write to
|
|
||||||
zip_url:
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
description: ZIP URL to download instead of Steam client
|
|
||||||
zip_root:
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
description: Root dir of ZIP which houses the executable and Data dir
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
- cron: '0 2 * * *'
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.cdn_branch }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
VIDEOS_SHEET: ${{ secrets.VIDEOS_SHEET }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
|
||||||
WOTB_DLC_CDN: ${{ secrets.WOTB_DLC_CDN }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
PUBLIC_ASSET_BRANCH: ${{ github.event.inputs.cdn_branch || secrets.PUBLIC_ASSET_BRANCH }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
download_client:
|
|
||||||
name: Download client
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: (ZIP) Maximize build space
|
|
||||||
if: github.event.inputs.zip_url != ''
|
|
||||||
uses: easimon/maximize-build-space@master
|
|
||||||
with:
|
|
||||||
root-reserve-mb: 512
|
|
||||||
swap-size-mb: 1024
|
|
||||||
remove-dotnet: 'true'
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
|
||||||
|
|
||||||
- name: (Steam) Setup bun
|
|
||||||
uses: oven-sh/setup-bun@v1
|
|
||||||
if: github.event.inputs.zip_url == ''
|
|
||||||
|
|
||||||
- name: (Steam) Install dependencies
|
|
||||||
if: github.event.inputs.zip_url == ''
|
|
||||||
run: bun install
|
|
||||||
|
|
||||||
- name: (Steam) Setup DepotDownloader
|
|
||||||
if: github.event.inputs.zip_url == ''
|
|
||||||
run: bun run setup:depotdownloader
|
|
||||||
|
|
||||||
- name: (Steam) Download client
|
|
||||||
if: github.event.inputs.zip_url == ''
|
|
||||||
run: |
|
|
||||||
chmod +x ./temp/depotDownloader/DepotDownloader
|
|
||||||
./temp/depotDownloader/DepotDownloader -q -os windows -app 444200 -username ${{ secrets.DEPOT_DOWNLOADER_USERNAME }} -password "${{ secrets.DEPOT_DOWNLOADER_PASSWORD }}"
|
|
||||||
|
|
||||||
- name: (Steam) Apply patches
|
|
||||||
if: github.event.inputs.zip_url == ''
|
|
||||||
run: bun setup:patches --depot
|
|
||||||
|
|
||||||
- name: (ZIP) Download client
|
|
||||||
if: github.event.inputs.zip_url != ''
|
|
||||||
env:
|
|
||||||
ZIP_URL: ${{ github.event.inputs.zip_url }}
|
|
||||||
ZIP_ROOT: ${{ github.event.inputs.zip_root }}
|
|
||||||
run: |
|
|
||||||
wget -q -O client.zip $ZIP_URL
|
|
||||||
unzip -q client.zip -d client
|
|
||||||
rm client.zip
|
|
||||||
mkdir -p depots/444202/0
|
|
||||||
mv client/$ZIP_ROOT/* depots/444202/0
|
|
||||||
|
|
||||||
- name: Archive depots
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: depots
|
|
||||||
path: depots
|
|
||||||
|
|
||||||
build_assets:
|
|
||||||
name: Build assets
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: download_client
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup bun
|
|
||||||
uses: oven-sh/setup-bun@v1
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: bun install
|
|
||||||
|
|
||||||
- name: Download depots
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: depots
|
|
||||||
path: depots
|
|
||||||
|
|
||||||
- name: Build assets
|
|
||||||
run: bun run build:assets --all-targets --depot --production
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
name: Averages
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 8 * * *'
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: oven-sh/setup-bun@v1
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: bun install
|
|
||||||
|
|
||||||
- name: Build averages
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_BRANCH: main
|
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
VIDEOS_SHEET: ${{ secrets.VIDEOS_SHEET }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
run: bun run build:averages --production
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
name: Build Website
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: main
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
- cron: '0 4 * * *'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
|
||||||
ALLOW_ROBOTS: true
|
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: oven-sh/setup-bun@v1
|
|
||||||
- uses: actions/configure-pages@v5
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: bun install
|
|
||||||
|
|
||||||
- name: Build website
|
|
||||||
run: bun run build:website
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-pages-artifact@v3
|
|
||||||
with:
|
|
||||||
path: dist/website
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Deploy
|
|
||||||
steps:
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
id: deployment
|
|
||||||
uses: actions/deploy-pages@v4
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
name: Discover IDs
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * 1'
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: oven-sh/setup-bun@v1
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: bun install
|
|
||||||
|
|
||||||
- name: Discover IDs
|
|
||||||
run: bun build:ids --production
|
|
||||||
@@ -20,6 +20,8 @@ env:
|
|||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
||||||
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
||||||
|
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
||||||
|
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
host:
|
host:
|
||||||
@@ -27,12 +29,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: oven-sh/setup-bun@v1
|
- uses: oven-sh/setup-bun@v1
|
||||||
# with:
|
# with:
|
||||||
# bun-version: 1.1.33
|
# bun-version: 1.1.33
|
||||||
|
|
||||||
- name: Download release assets
|
- name: Download release assets
|
||||||
run: |
|
run: |
|
||||||
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/tresabhi/blitzkit/releases/latest \
|
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/blitzkit/blitzkit/releases/latest \
|
||||||
| grep "browser_download_url.*bot.zip" \
|
| grep "browser_download_url.*bot.zip" \
|
||||||
| cut -d : -f 2,3 \
|
| cut -d : -f 2,3 \
|
||||||
| tr -d \")
|
| tr -d \")
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
name: Rating Asia
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 17 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
host:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: oven-sh/setup-bun@v1
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: bun install
|
|
||||||
|
|
||||||
- name: Generate leaderboard
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_BRANCH: main
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
run: bun build:ratingleaderboard --region=asia
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
name: Rating Europe
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 23 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
host:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: oven-sh/setup-bun@v1
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: bun install
|
|
||||||
|
|
||||||
- name: Generate leaderboard
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_BRANCH: main
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
run: bun build:ratingleaderboard --region=eu
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
name: Rating North America
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
host:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: oven-sh/setup-bun@v1
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: bun install
|
|
||||||
|
|
||||||
- name: Generate leaderboard
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_BRANCH: main
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
run: bun build:ratingleaderboard --region=com
|
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
name: Website
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
schedule:
|
||||||
|
- cron: '0 4 * * *'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
|
||||||
|
env:
|
||||||
|
AUTO_PROXY_ORIGIN: ${{ secrets.AUTO_PROXY_ORIGIN }}
|
||||||
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
||||||
|
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
token: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: latest
|
||||||
|
|
||||||
|
- name: Configure pages
|
||||||
|
uses: actions/configure-pages@v5
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun install
|
||||||
|
|
||||||
|
- name: Build website
|
||||||
|
run: bun run build:website
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-pages-artifact@v3
|
||||||
|
with:
|
||||||
|
path: dist/website
|
||||||
|
|
||||||
|
deploy-github-pages:
|
||||||
|
name: Deploy to GitHub Pages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
if: >
|
||||||
|
(github.repository == 'tresabhi/blitzkit' && github.ref == 'refs/heads/main') ||
|
||||||
|
(github.repository == 'blitzkit/host-redux' && github.ref == 'refs/heads/ue4')
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v4
|
||||||
+229
-4
@@ -1,14 +1,14 @@
|
|||||||
node_modules
|
node_modules
|
||||||
_node_modules
|
_node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
.env
|
*.env
|
||||||
/test-results/
|
/test-results/
|
||||||
/playwright-report/
|
/playwright-report/
|
||||||
/playwright/.cache/
|
/playwright/.cache/
|
||||||
dist/
|
dist/
|
||||||
dist.*
|
dist.*
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
/test.*
|
test.*
|
||||||
/docs/.vitepress/dist
|
/docs/.vitepress/dist
|
||||||
/docs/.vitepress/cache
|
/docs/.vitepress/cache
|
||||||
servers.csv
|
servers.csv
|
||||||
@@ -22,7 +22,232 @@ depots
|
|||||||
public/sitemap*
|
public/sitemap*
|
||||||
/firebase.json
|
/firebase.json
|
||||||
target
|
target
|
||||||
# packages/core/src/protos/*
|
|
||||||
# !packages/core/src/protos/*.proto
|
|
||||||
/.vercel
|
/.vercel
|
||||||
/.astro
|
/.astro
|
||||||
|
.vercel
|
||||||
|
/packages/bot/src/prisma
|
||||||
|
|
||||||
|
*.rsuser
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.userosscache
|
||||||
|
*.sln.docstates
|
||||||
|
*.userprefs
|
||||||
|
mono_crash.*
|
||||||
|
[Dd]ebugPublic/
|
||||||
|
[Rr]elease/
|
||||||
|
[Rr]eleases/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
[Ww][Ii][Nn]32/
|
||||||
|
[Aa][Rr][Mm]/
|
||||||
|
[Aa][Rr][Mm]64/
|
||||||
|
[Aa][Rr][Mm]64[Ee][Cc]/
|
||||||
|
bld/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Oo]ut/
|
||||||
|
[Ll]og/
|
||||||
|
[Ll]ogs/
|
||||||
|
.vs/
|
||||||
|
Generated\ Files/
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
*.VisualState.xml
|
||||||
|
TestResult.xml
|
||||||
|
nunit-*.xml
|
||||||
|
[Dd]ebugPS/
|
||||||
|
[Rr]eleasePS/
|
||||||
|
dlldata.c
|
||||||
|
BenchmarkDotNet.Artifacts/
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
ScaffoldingReadMe.txt
|
||||||
|
StyleCopReport.xml
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*_h.h
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.idb
|
||||||
|
*.iobj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.ipdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
!Directory.Build.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*_wpftmp.csproj
|
||||||
|
*.log
|
||||||
|
*.tlog
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.svclog
|
||||||
|
*.scc
|
||||||
|
_Chutzpah*
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opendb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
*.VC.db
|
||||||
|
*.VC.VC.opendb
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
*.sap
|
||||||
|
*.e2e
|
||||||
|
$tf/
|
||||||
|
*.gpState
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
*.DotSettings.user
|
||||||
|
_TeamCity*
|
||||||
|
*.dotCover
|
||||||
|
.axoCover/*
|
||||||
|
|
||||||
|
|
||||||
|
!.axoCover/settings.json
|
||||||
|
coverage*.json
|
||||||
|
coverage*.xml
|
||||||
|
coverage*.info
|
||||||
|
*.coverage
|
||||||
|
*.coveragexml
|
||||||
|
_NCrunch_*
|
||||||
|
.NCrunch_*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
nCrunchTemp_*
|
||||||
|
*.mm.*
|
||||||
|
AutoTest.Net/
|
||||||
|
.sass-cache/
|
||||||
|
[Ee]xpress/
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
publish/
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.azurePubxml
|
||||||
|
*.pubxml
|
||||||
|
*.publishproj
|
||||||
|
PublishScripts/
|
||||||
|
|
||||||
|
*.nupkg
|
||||||
|
*.snupkg
|
||||||
|
*.nuget.props
|
||||||
|
*.nuget.targets
|
||||||
|
csx/
|
||||||
|
|
||||||
|
*.build.csdef
|
||||||
|
ecf/
|
||||||
|
rcf/
|
||||||
|
AppPackages/
|
||||||
|
BundleArtifacts/
|
||||||
|
Package.StoreAssociation.xml
|
||||||
|
_pkginfo.txt
|
||||||
|
*.appx
|
||||||
|
*.appxbundle
|
||||||
|
*.appxupload
|
||||||
|
*.[Cc]ache
|
||||||
|
!?*.[Cc]ache/
|
||||||
|
ClientBin/
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.dbproj.schemaview
|
||||||
|
*.jfm
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
orleans.codegen.cs
|
||||||
|
|
||||||
|
Generated_Code/
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
ServiceFabricBackup/
|
||||||
|
*.rptproj.bak
|
||||||
|
*.mdf
|
||||||
|
*.ldf
|
||||||
|
*.ndf
|
||||||
|
*.rdl.data
|
||||||
|
*.bim.layout
|
||||||
|
*.bim_*.settings
|
||||||
|
*.rptproj.rsuser
|
||||||
|
*- [Bb]ackup.rdl
|
||||||
|
*- [Bb]ackup ([0-9]).rdl
|
||||||
|
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||||
|
FakesAssemblies/
|
||||||
|
*.GhostDoc.xml
|
||||||
|
.ntvs_analysis.dat
|
||||||
|
node_modules/
|
||||||
|
*.plg
|
||||||
|
*.opt
|
||||||
|
*.vbw
|
||||||
|
*.vbp
|
||||||
|
*.dsw
|
||||||
|
*.dsp
|
||||||
|
*.ncb
|
||||||
|
*.aps
|
||||||
|
**/*.HTMLClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/ModelManifest.xml
|
||||||
|
**/*.Server/GeneratedArtifacts
|
||||||
|
**/*.Server/ModelManifest.xml
|
||||||
|
_Pvt_Extensions
|
||||||
|
.paket/paket.exe
|
||||||
|
paket-files/
|
||||||
|
.fake/
|
||||||
|
.cr/personal
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
*.tss
|
||||||
|
*.jmconfig
|
||||||
|
*.btp.cs
|
||||||
|
*.btm.cs
|
||||||
|
*.odx.cs
|
||||||
|
*.xsd.cs
|
||||||
|
OpenCover/
|
||||||
|
ASALocalRun/
|
||||||
|
*.binlog
|
||||||
|
.aws-sam
|
||||||
|
*.nvuser
|
||||||
|
.mfractor/
|
||||||
|
.localhistory/
|
||||||
|
.vshistory/
|
||||||
|
healthchecksdb
|
||||||
|
MigrationBackup/
|
||||||
|
.ionide/
|
||||||
|
FodyWeavers.xsd
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
*.code-workspace
|
||||||
|
.history/
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msix
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
*.sln.iml
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
[submodule "submodules/blitzkit-closed"]
|
[submodule "submodules/blitzkit-closed"]
|
||||||
path = submodules/blitzkit-closed
|
path = submodules/blitzkit-closed
|
||||||
url = https://github.com/tresabhi/blitzkit-closed
|
url = https://github.com/tresabhi/blitzkit-closed
|
||||||
|
[submodule "submodules/CUE4Parse"]
|
||||||
|
path = submodules/CUE4Parse
|
||||||
|
url = https://github.com/FabianFG/CUE4Parse
|
||||||
|
[submodule "submodules/blitzkit-internal"]
|
||||||
|
path = submodules/blitzkit-internal
|
||||||
|
url = https://github.com/blitzkit/internal
|
||||||
Vendored
+22
-1
@@ -7,11 +7,14 @@
|
|||||||
"adsense",
|
"adsense",
|
||||||
"aeson",
|
"aeson",
|
||||||
"alphatest",
|
"alphatest",
|
||||||
|
"analyticsdata",
|
||||||
|
"analyticsreporting",
|
||||||
"APAC",
|
"APAC",
|
||||||
"apcr",
|
"apcr",
|
||||||
"applypatches",
|
"applypatches",
|
||||||
"artefacts",
|
"artefacts",
|
||||||
"astrojs",
|
"astrojs",
|
||||||
|
"astrolib",
|
||||||
"atgm",
|
"atgm",
|
||||||
"Autoloader",
|
"Autoloader",
|
||||||
"Autoreloader",
|
"Autoreloader",
|
||||||
@@ -33,6 +36,7 @@
|
|||||||
"cacheable",
|
"cacheable",
|
||||||
"Callouts",
|
"Callouts",
|
||||||
"Camo",
|
"Camo",
|
||||||
|
"Carro",
|
||||||
"CCPAOPTOUT",
|
"CCPAOPTOUT",
|
||||||
"CDON",
|
"CDON",
|
||||||
"classname",
|
"classname",
|
||||||
@@ -40,17 +44,20 @@
|
|||||||
"closedkrieg",
|
"closedkrieg",
|
||||||
"cockroackdb",
|
"cockroackdb",
|
||||||
"Coef",
|
"Coef",
|
||||||
|
"Combattimento",
|
||||||
"cooldown",
|
"cooldown",
|
||||||
"corelations",
|
"corelations",
|
||||||
"corsproxy",
|
"corsproxy",
|
||||||
"CUBEMAP",
|
"CUBEMAP",
|
||||||
"CUBETEXCOORD",
|
"CUBETEXCOORD",
|
||||||
"customperiod",
|
"customperiod",
|
||||||
|
"Datacard",
|
||||||
"datasource",
|
"datasource",
|
||||||
"Dava",
|
"Dava",
|
||||||
"dbid",
|
"dbid",
|
||||||
"Ddpf",
|
"Ddpf",
|
||||||
"Ddsd",
|
"Ddsd",
|
||||||
|
"deadrail",
|
||||||
"debugflags",
|
"debugflags",
|
||||||
"deburr",
|
"deburr",
|
||||||
"decalmask",
|
"decalmask",
|
||||||
@@ -62,6 +69,7 @@
|
|||||||
"DIDS",
|
"DIDS",
|
||||||
"donotremove",
|
"donotremove",
|
||||||
"drei",
|
"drei",
|
||||||
|
"dsapp",
|
||||||
"dvpd",
|
"dvpd",
|
||||||
"dvpl",
|
"dvpl",
|
||||||
"DVPLCRC",
|
"DVPLCRC",
|
||||||
@@ -80,6 +88,7 @@
|
|||||||
"gameplay",
|
"gameplay",
|
||||||
"glsl",
|
"glsl",
|
||||||
"GLTF",
|
"GLTF",
|
||||||
|
"gtag",
|
||||||
"haha",
|
"haha",
|
||||||
"highp",
|
"highp",
|
||||||
"iife",
|
"iife",
|
||||||
@@ -94,6 +103,7 @@
|
|||||||
"leaderboards",
|
"leaderboards",
|
||||||
"lerp",
|
"lerp",
|
||||||
"LINEARSIZE",
|
"LINEARSIZE",
|
||||||
|
"lmao",
|
||||||
"loadouts",
|
"loadouts",
|
||||||
"loddist",
|
"loddist",
|
||||||
"lods",
|
"lods",
|
||||||
@@ -101,6 +111,7 @@
|
|||||||
"Maddoxkkm",
|
"Maddoxkkm",
|
||||||
"malum",
|
"malum",
|
||||||
"mantlets",
|
"mantlets",
|
||||||
|
"mediump",
|
||||||
"metallicness",
|
"metallicness",
|
||||||
"metalness",
|
"metalness",
|
||||||
"minitelrose",
|
"minitelrose",
|
||||||
@@ -120,6 +131,7 @@
|
|||||||
"noout",
|
"noout",
|
||||||
"normalmap",
|
"normalmap",
|
||||||
"oneof",
|
"oneof",
|
||||||
|
"oodle",
|
||||||
"oopsies",
|
"oopsies",
|
||||||
"Oopsy",
|
"Oopsy",
|
||||||
"opentest",
|
"opentest",
|
||||||
@@ -127,9 +139,12 @@
|
|||||||
"outdir",
|
"outdir",
|
||||||
"outfile",
|
"outfile",
|
||||||
"ownedtanks",
|
"ownedtanks",
|
||||||
|
"padder",
|
||||||
|
"partytown",
|
||||||
"PIXELFORMAT",
|
"PIXELFORMAT",
|
||||||
"playerachievements",
|
"playerachievements",
|
||||||
"playerinfo",
|
"playerinfo",
|
||||||
|
"playform",
|
||||||
"pngjs",
|
"pngjs",
|
||||||
"POSITIVEX",
|
"POSITIVEX",
|
||||||
"POSITIVEY",
|
"POSITIVEY",
|
||||||
@@ -178,14 +193,19 @@
|
|||||||
"TEXCOORD",
|
"TEXCOORD",
|
||||||
"tresabhi",
|
"tresabhi",
|
||||||
"tungstentip",
|
"tungstentip",
|
||||||
|
"Turretless",
|
||||||
"TYPELESS",
|
"TYPELESS",
|
||||||
"ubjson",
|
"ubjson",
|
||||||
|
"Uncompiled",
|
||||||
|
"undiscriminated",
|
||||||
"Unicum",
|
"Unicum",
|
||||||
"UNLOCALIZED",
|
"UNLOCALIZED",
|
||||||
"UNORM",
|
"UNORM",
|
||||||
"unpickled",
|
"unpickled",
|
||||||
"Unregistering",
|
"Unregistering",
|
||||||
"unrotate",
|
"unrotate",
|
||||||
|
"unwrapper",
|
||||||
|
"vercel",
|
||||||
"vickers",
|
"vickers",
|
||||||
"vitepress",
|
"vitepress",
|
||||||
"Vovko",
|
"Vovko",
|
||||||
@@ -213,5 +233,6 @@
|
|||||||
"deno.unstable": false,
|
"deno.unstable": false,
|
||||||
"cSpell.enableFiletypes": ["glsl", "proto3"],
|
"cSpell.enableFiletypes": ["glsl", "proto3"],
|
||||||
"typescript.tsdk": "node_modules\\typescript\\lib",
|
"typescript.tsdk": "node_modules\\typescript\\lib",
|
||||||
"liveServer.settings.multiRootWorkspaceName": "blitzkit"
|
"liveServer.settings.multiRootWorkspaceName": "blitzkit",
|
||||||
|
"git.ignoreLimitWarning": true
|
||||||
}
|
}
|
||||||
Vendored
+41
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "build",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"${workspaceFolder}/BlitzKit.sln",
|
||||||
|
"/property:GenerateFullPaths=true",
|
||||||
|
"/consoleloggerparameters:NoSummary;ForceNoAlign"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "publish",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"publish",
|
||||||
|
"${workspaceFolder}/BlitzKit.sln",
|
||||||
|
"/property:GenerateFullPaths=true",
|
||||||
|
"/consoleloggerparameters:NoSummary;ForceNoAlign"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "watch",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"watch",
|
||||||
|
"run",
|
||||||
|
"--project",
|
||||||
|
"${workspaceFolder}/BlitzKit.sln"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.0.31903.59
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F23F76D4-C350-4BBA-9DF1-E67C5CD391B1}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlitzKit.FFI", "src\BlitzKit.FFI\BlitzKit.FFI.csproj", "{8E798C66-C863-4A67-87EA-853109EEE037}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{8E798C66-C863-4A67-87EA-853109EEE037}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{8E798C66-C863-4A67-87EA-853109EEE037}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{8E798C66-C863-4A67-87EA-853109EEE037}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{8E798C66-C863-4A67-87EA-853109EEE037}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{8E798C66-C863-4A67-87EA-853109EEE037} = {F23F76D4-C350-4BBA-9DF1-E67C5CD391B1}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -1,661 +0,0 @@
|
|||||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 19 November 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU Affero General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works, specifically designed to ensure
|
|
||||||
cooperation with the community in the case of network server software.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
our General Public Licenses are intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
Developers that use our General Public Licenses protect your rights
|
|
||||||
with two steps: (1) assert copyright on the software, and (2) offer
|
|
||||||
you this License which gives you legal permission to copy, distribute
|
|
||||||
and/or modify the software.
|
|
||||||
|
|
||||||
A secondary benefit of defending all users' freedom is that
|
|
||||||
improvements made in alternate versions of the program, if they
|
|
||||||
receive widespread use, become available for other developers to
|
|
||||||
incorporate. Many developers of free software are heartened and
|
|
||||||
encouraged by the resulting cooperation. However, in the case of
|
|
||||||
software used on network servers, this result may fail to come about.
|
|
||||||
The GNU General Public License permits making a modified version and
|
|
||||||
letting the public access it on a server without ever releasing its
|
|
||||||
source code to the public.
|
|
||||||
|
|
||||||
The GNU Affero General Public License is designed specifically to
|
|
||||||
ensure that, in such cases, the modified source code becomes available
|
|
||||||
to the community. It requires the operator of a network server to
|
|
||||||
provide the source code of the modified version running there to the
|
|
||||||
users of that server. Therefore, public use of a modified version, on
|
|
||||||
a publicly accessible server, gives the public access to the source
|
|
||||||
code of the modified version.
|
|
||||||
|
|
||||||
An older license, called the Affero General Public License and
|
|
||||||
published by Affero, was designed to accomplish similar goals. This is
|
|
||||||
a different license, not a version of the Affero GPL, but Affero has
|
|
||||||
released a new version of the Affero GPL which permits relicensing under
|
|
||||||
this license.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, if you modify the
|
|
||||||
Program, your modified version must prominently offer all users
|
|
||||||
interacting with it remotely through a computer network (if your version
|
|
||||||
supports such interaction) an opportunity to receive the Corresponding
|
|
||||||
Source of your version by providing access to the Corresponding Source
|
|
||||||
from a network server at no charge, through some standard or customary
|
|
||||||
means of facilitating copying of software. This Corresponding Source
|
|
||||||
shall include the Corresponding Source for any work covered by version 3
|
|
||||||
of the GNU General Public License that is incorporated pursuant to the
|
|
||||||
following paragraph.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the work with which it is combined will remain governed by version
|
|
||||||
3 of the GNU General Public License.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU Affero General Public License from time to time. Such new versions
|
|
||||||
will be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU Affero General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU Affero General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU Affero General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Affero General Public License as published
|
|
||||||
by the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Affero General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If your software can interact with users remotely through a computer
|
|
||||||
network, you should also make sure that it provides a way for users to
|
|
||||||
get its source. For example, if your program is a web application, its
|
|
||||||
interface could display a "Source" link that leads users to an archive
|
|
||||||
of the code. There are many ways you could offer source, and different
|
|
||||||
solutions will be better for different programs; see section 13 for the
|
|
||||||
specific requirements.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
|
||||||
<https://www.gnu.org/licenses/>.
|
|
||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
# BlitzKit License
|
||||||
|
|
||||||
|
Version 1.1, August 5th, 2025. Copyright (c) TrèsAbhi.
|
||||||
|
|
||||||
|
Permission is hereby granted to anyone to:
|
||||||
|
|
||||||
|
- Fork, clone, and download the contents of this repository.
|
||||||
|
- Modify the code locally in private.
|
||||||
|
- Use and run the code **only for personal, non-public testing, or educational purposes**.
|
||||||
|
|
||||||
|
The following restrictions apply:
|
||||||
|
|
||||||
|
- You may **not** deploy, host, or make this project or any derivative publicly accessible.
|
||||||
|
- You may **not** share screenshots, recordings, or any form of media from this project unless you intend to merge your changes back into BlitzKit.
|
||||||
|
- You may **not** use this project or its contents in any public or commercial product.
|
||||||
|
- You may **not** redistribute modified or unmodified versions of this project.
|
||||||
|
|
||||||
|
Contributions:
|
||||||
|
|
||||||
|
- You are encouraged to propose changes or improvements via pull requests to the original BlitzKit repository.
|
||||||
|
- Any such contributions will be considered under the same license terms unless explicitly stated otherwise.
|
||||||
|
|
||||||
|
Violations of this license may result in revocation of usage rights and takedown requests.
|
||||||
|
|
||||||
|
For questions or licensing inquiries, contact support@blitzkit.app.
|
||||||
|
|
||||||
|
## Notes on Existing Forks
|
||||||
|
|
||||||
|
All forks fall under these categories:
|
||||||
|
|
||||||
|
- If your fork was made from commit `8462901` (Apr 17, 2023) or between commits `2958124` (Jul 3, 2023) and `85e483e` (Jul 13, 2024), your fork falls under the **MIT license**.
|
||||||
|
- If your fork was made from commits between `5646093` (Jul 13, 2024) and `e3f131c` (Aug 5, 2025), your fork falls under the **AGPL-3.0 license**.
|
||||||
|
- If your fork was made between commit `f7c356d` (Apr 17, 2023) and `2958124` (Jul 3, 2023), your fork falls under **a default exclusive copyright**.
|
||||||
|
- If your fork was made from commits between `e3f131c` (Aug 5, 2025) and today, your fork falls under **this license**.
|
||||||
|
|
||||||
|
MIT and AGPL-3.0 licensed fork owners:
|
||||||
|
|
||||||
|
- You may continue to use your fork of BlitzKit under the corresponding license.
|
||||||
|
- You may upgrade your fork up to commit `5cab394` (Aug 4, 2025) and keep the AGPL-3.0 license.
|
||||||
|
- You may upgrade to commit `e3f131c` (Aug 5, 2025) or beyond but have to **switch to this license** where all rules apply.
|
||||||
|
- If you upgrade to commit `e3f131c` (Aug 5, 2025) or beyond, you must retract all public deployments of BlitzKit.
|
||||||
|
- Existing screenshots, recordings, or any form of media can remain.
|
||||||
|
|
||||||
|
Default exclusive copyright fork owners:
|
||||||
|
|
||||||
|
- You may continue to use their forks under the AGPL-3.0 license as no license was applied to BlitzKit at the time of forking.
|
||||||
|
|
||||||
|
BlitzKit licensed fork owners:
|
||||||
|
|
||||||
|
- You may continue to upgrade to the latest commits only under the conditions of this license.
|
||||||
@@ -1,14 +1,10 @@
|
|||||||
## Visit the website
|
## BlitzKit
|
||||||
|
|
||||||
|
Your premier source for all things Blitz.
|
||||||
|
|
||||||
### https://blitzkit.app/
|
### https://blitzkit.app/
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# BlitzKit
|
|
||||||
|
|
||||||
[](https://codeium.com)
|
|
||||||
|
|
||||||
Tools for everything World of Tanks Blitz
|
|
||||||
|
|
||||||
## Invite the bot
|
## Invite the bot
|
||||||
|
|
||||||
@@ -16,8 +12,11 @@ Go to [application directory for BlitzKit](https://discord.com/application-direc
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Visit the documentation website
|
## Naming Guide
|
||||||
|
|
||||||
### https://tresabhi.github.io/blitzkit/
|
| Type | Style | Example |
|
||||||
|
| --------- | -------------- | ---------------------------------------------------------------- |
|
||||||

|
| In-text | CamelCase | BlitzKit |
|
||||||
|
| Code | lowerCamelCase | `let blitzkit = { ... }`, `function fetchBlitzkitData() { ... }` |
|
||||||
|
| URLs | kebab-case | `https://example.com/blitzkit/` |
|
||||||
|
| Constants | SNAKE_CASE | `const BLITZKIT_VERSION = "1.0.0"` |
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
{
|
||||||
|
"name": "blitzkit",
|
||||||
|
"private": true,
|
||||||
|
"version": "1.27.11",
|
||||||
|
"description": "🎉 Tools for everything World of Tanks Blitz",
|
||||||
|
"type": "module",
|
||||||
|
"types": "./types.d.ts",
|
||||||
|
"workspaces": ["packages/*", "submodules/*"],
|
||||||
|
"scripts": {
|
||||||
|
"build:assets": "cd packages/scripts && bun run build:assets",
|
||||||
|
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
|
||||||
|
"build:bot": "cd packages/scripts && bun run build:bot",
|
||||||
|
"build:website": "bun build:prisma --no-hints && cd packages/website && bun run build",
|
||||||
|
"build:prisma": "prisma generate",
|
||||||
|
"build:sitemap": "bun scripts/sitemap.ts",
|
||||||
|
"build:docs": "vitepress build docs",
|
||||||
|
"build:ratingleaderboard": "cd packages/scripts && bun run build:ratingleaderboard",
|
||||||
|
"dev:bot": "bun run build:bot --dev && bun start:bot",
|
||||||
|
"start:bot": "bun dist/bot/main.js",
|
||||||
|
"dev:docs": "vitepress dev docs",
|
||||||
|
"dev:website": "cd packages/website-ue && bun run dev",
|
||||||
|
"dev:api": "bun --filter=@blitzkit/api run dev",
|
||||||
|
"setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader",
|
||||||
|
"setup:patches": "bun --filter=@blitzkit/scripts run setup:patches",
|
||||||
|
"start:website": "bun --filter=@blitzkit/website run start",
|
||||||
|
"host:docs": "vitepress preview docs",
|
||||||
|
"lint": "tsc",
|
||||||
|
"lint:website": "cd packages/website && bun run lint",
|
||||||
|
"format": "prettier --write \"**/*.@(json|js|jsx|css|md|ts|tsx|html|xml|yml|gltf)\"",
|
||||||
|
"update": "yarn upgrade --latest",
|
||||||
|
"tunnel": "cloudflared tunnel --url http://localhost:3000",
|
||||||
|
"discoverids": "scripts/discoverIds.ts",
|
||||||
|
"build:protos": "bun packages/scripts/src/protos.ts",
|
||||||
|
"preview:website": "cd packages/website && bun run preview",
|
||||||
|
"build:reviews": "cd packages/scripts && bun build:reviews",
|
||||||
|
"build:ids": "cd packages/scripts && bun build:ids",
|
||||||
|
"prunestrings": "cd packages/scripts && bun prunestrings"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"satori": "^0.10.14",
|
||||||
|
"@resvg/resvg-js": "^2.6.2",
|
||||||
|
"discord.js": "^14.16.3",
|
||||||
|
"bepaint": "^0.1.0-beta.3",
|
||||||
|
"markdown-escape": "^2.0.0",
|
||||||
|
"@types/markdown-escape": "^1.1.3",
|
||||||
|
"@types/adm-zip": "^0.5.5",
|
||||||
|
"@types/lz4js": "^0.2.1",
|
||||||
|
"@octokit/plugin-throttling": "^8.2.0",
|
||||||
|
"@octokit/rest": "^20.1.1",
|
||||||
|
"@prisma/client": "^6.6.0",
|
||||||
|
"adm-zip": "^0.5.16",
|
||||||
|
"crc": "^4.3.2",
|
||||||
|
"dotenv": "^16.4.5",
|
||||||
|
"lz4js": "^0.2.0",
|
||||||
|
"yaml": "^2.5.0",
|
||||||
|
"ts-deepmerge": "^7.0.2",
|
||||||
|
"@types/decompress": "^4.2.7",
|
||||||
|
"@types/progress": "^2.0.7",
|
||||||
|
"@gltf-transform/core": "^4.0.10",
|
||||||
|
"@gltf-transform/extensions": "^4.0.10",
|
||||||
|
"@gltf-transform/functions": "^4.0.10",
|
||||||
|
"csv-parse": "^5.5.6",
|
||||||
|
"decompress": "^4.2.1",
|
||||||
|
"esbuild": "^0.19.12",
|
||||||
|
"fast-xml-parser": "^4.4.1",
|
||||||
|
"progress": "^2.0.3",
|
||||||
|
"puppeteer": "^23.10.4",
|
||||||
|
"@astrojs/check": "^0.9.4",
|
||||||
|
"@playform/compress": "^0.1.9",
|
||||||
|
"@playform/inline": "^0.1.2",
|
||||||
|
"@types/js-cookie": "^3.0.6",
|
||||||
|
"astro-compressor": "^1.0.0",
|
||||||
|
"@fontsource/inter": "^5.2.5",
|
||||||
|
"@nanostores/persistent": "^0.10.2",
|
||||||
|
"@nanostores/react": "^0.7.3",
|
||||||
|
"@nivo/bar": "^0.87.0",
|
||||||
|
"@nivo/line": "^0.88.0",
|
||||||
|
"compare-versions": "^6.1.1",
|
||||||
|
"echarts": "^5.5.1",
|
||||||
|
"js-cookie": "^3.0.5",
|
||||||
|
"markdown-to-jsx": "^7.5.0",
|
||||||
|
"nanostores": "^0.11.3",
|
||||||
|
"react-device-detect": "^2.2.3",
|
||||||
|
"react-promise-suspense": "^0.3.4",
|
||||||
|
"urlon": "^3.1.0",
|
||||||
|
"@types/bun": "latest",
|
||||||
|
"@types/node": "^22.14.1",
|
||||||
|
"prisma": "^6.6.0",
|
||||||
|
"typescript": "^5.8.3",
|
||||||
|
"googleapis": "^144.0.0",
|
||||||
|
"protobufjs": "^7.5.2",
|
||||||
|
"quicklime": "^1.2.0",
|
||||||
|
"sharp": "^0.33.5"
|
||||||
|
}
|
||||||
|
}
|
||||||
+124
@@ -0,0 +1,124 @@
|
|||||||
|
{
|
||||||
|
"name": "blitzkit",
|
||||||
|
"private": true,
|
||||||
|
"version": "1.27.11",
|
||||||
|
"description": "🎉 Tools for everything World of Tanks Blitz",
|
||||||
|
"type": "module",
|
||||||
|
"types": "./types.d.ts",
|
||||||
|
"workspaces": [
|
||||||
|
"packages/*",
|
||||||
|
"submodules/*"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"build:assets": "cd packages/scripts && bun run build:assets",
|
||||||
|
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
|
||||||
|
"build:bot": "cd packages/scripts && bun run build:bot",
|
||||||
|
"build:website": "bun build:prisma --no-hints && cd packages/website && bun run build",
|
||||||
|
"build:prisma": "prisma generate",
|
||||||
|
"build:sitemap": "bun scripts/sitemap.ts",
|
||||||
|
"build:docs": "vitepress build docs",
|
||||||
|
"build:ratingleaderboard": "cd packages/scripts && bun run build:ratingleaderboard",
|
||||||
|
"dev:bot": "bun run build:bot --dev && bun start:bot",
|
||||||
|
"start:bot": "bun dist/bot/main.js",
|
||||||
|
"dev:docs": "vitepress dev docs",
|
||||||
|
"dev:website": "cd packages/website-ue && bun run dev",
|
||||||
|
"dev:api": "bun --filter=@blitzkit/api run dev",
|
||||||
|
"setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader",
|
||||||
|
"setup:patches": "bun --filter=@blitzkit/scripts run setup:patches",
|
||||||
|
"start:website": "bun --filter=@blitzkit/website run start",
|
||||||
|
"host:docs": "vitepress preview docs",
|
||||||
|
"lint": "tsc",
|
||||||
|
"lint:website": "cd packages/website && bun run lint",
|
||||||
|
"format": "prettier --write \"**/*.@(json|js|jsx|css|md|ts|tsx|html|xml|yml|gltf)\"",
|
||||||
|
"update": "yarn upgrade --latest",
|
||||||
|
"tunnel": "cloudflared tunnel --url http://localhost:3000",
|
||||||
|
"discoverids": "scripts/discoverIds.ts",
|
||||||
|
"build:protos": "bun packages/scripts/src/protos.ts",
|
||||||
|
"preview:website": "cd packages/website && bun run preview",
|
||||||
|
"build:reviews": "cd packages/scripts && bun build:reviews",
|
||||||
|
"build:ids": "cd packages/scripts && bun build:ids",
|
||||||
|
"prunestrings": "cd packages/scripts && bun prunestrings"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"satori": "^0.10.14",
|
||||||
|
"@resvg/resvg-js": "^2.6.2",
|
||||||
|
"discord.js": "^14.16.3",
|
||||||
|
"fuzzysort": "^2.0.4",
|
||||||
|
"bepaint": "^0.1.0-beta.3",
|
||||||
|
"markdown-escape": "^2.0.0",
|
||||||
|
"@types/markdown-escape": "^1.1.3",
|
||||||
|
"@types/adm-zip": "^0.5.5",
|
||||||
|
"@types/lz4js": "^0.2.1",
|
||||||
|
"@octokit/plugin-throttling": "^8.2.0",
|
||||||
|
"@octokit/rest": "^20.1.1",
|
||||||
|
"@prisma/client": "^6.6.0",
|
||||||
|
"adm-zip": "^0.5.16",
|
||||||
|
"crc": "^4.3.2",
|
||||||
|
"dotenv": "^16.4.5",
|
||||||
|
"lz4js": "^0.2.0",
|
||||||
|
"ts-proto": "^2.2.2",
|
||||||
|
"yaml": "^2.5.0",
|
||||||
|
"ts-deepmerge": "^7.0.2",
|
||||||
|
"@types/decompress": "^4.2.7",
|
||||||
|
"@types/progress": "^2.0.7",
|
||||||
|
"@gltf-transform/core": "^4.0.10",
|
||||||
|
"@gltf-transform/extensions": "^4.0.10",
|
||||||
|
"@gltf-transform/functions": "^4.0.10",
|
||||||
|
"csv-parse": "^5.5.6",
|
||||||
|
"decompress": "^4.2.1",
|
||||||
|
"esbuild": "^0.19.12",
|
||||||
|
"fast-xml-parser": "^4.4.1",
|
||||||
|
"progress": "^2.0.3",
|
||||||
|
"puppeteer": "^23.10.4",
|
||||||
|
"@astrojs/check": "^0.9.4",
|
||||||
|
"@astrojs/sitemap": "^3.2.1",
|
||||||
|
"@playform/compress": "^0.1.9",
|
||||||
|
"@playform/inline": "^0.1.2",
|
||||||
|
"@types/js-cookie": "^3.0.6",
|
||||||
|
"@types/three": "^0.160.0",
|
||||||
|
"astro-compressor": "^1.0.0",
|
||||||
|
"@astrojs/partytown": "^2.1.4",
|
||||||
|
"@astrolib/seo": "^1.0.0-beta.8",
|
||||||
|
"@fontsource/inter": "^5.2.5",
|
||||||
|
"@nanostores/persistent": "^0.10.2",
|
||||||
|
"@nanostores/react": "^0.7.3",
|
||||||
|
"@nivo/bar": "^0.87.0",
|
||||||
|
"@nivo/line": "^0.88.0",
|
||||||
|
"@radix-ui/colors": "^3.0.0",
|
||||||
|
"@radix-ui/react-icons": "^1.3.0",
|
||||||
|
"@radix-ui/themes": "^3.1.4",
|
||||||
|
"@react-three/drei": "^9.115.0",
|
||||||
|
"@react-three/fiber": "^8.17.10",
|
||||||
|
"compare-versions": "^6.1.1",
|
||||||
|
"echarts": "^5.5.1",
|
||||||
|
"immer": "^10.1.1",
|
||||||
|
"js-cookie": "^3.0.5",
|
||||||
|
"markdown-to-jsx": "^7.5.0",
|
||||||
|
"nanostores": "^0.11.3",
|
||||||
|
"react-device-detect": "^2.2.3",
|
||||||
|
"react-promise-suspense": "^0.3.4",
|
||||||
|
"three": "^0.169.0",
|
||||||
|
"urlon": "^3.1.0",
|
||||||
|
"zustand": "^4.5.5",
|
||||||
|
"@types/bun": "latest",
|
||||||
|
"@types/lodash-es": "^4.17.12",
|
||||||
|
"@types/node": "^22.14.1",
|
||||||
|
"prettier": "^3.5.3",
|
||||||
|
"prisma": "^6.6.0",
|
||||||
|
"typescript": "^5.8.3",
|
||||||
|
"googleapis": "^144.0.0",
|
||||||
|
"lodash-es": "^4.17.21",
|
||||||
|
"protobufjs": "^7.5.2",
|
||||||
|
"quicklime": "^1.2.0",
|
||||||
|
"sharp": "^0.33.5",
|
||||||
|
"@blitzkit/core": "workspace:*",
|
||||||
|
"@blitzkit/i18n": "workspace:*",
|
||||||
|
"@astrojs/react": "^4.3.0",
|
||||||
|
"@types/react": "^19.1.5",
|
||||||
|
"@types/react-dom": "^19.1.5",
|
||||||
|
"astro": "^5.8.0",
|
||||||
|
"react": "^19.1.0",
|
||||||
|
"react-dom": "^19.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
files:
|
files:
|
||||||
- source: /packages/core/lang/en-US.json
|
- source: /packages/i18n/strings/en.json
|
||||||
translation: /%original_path%/%locale%.json
|
translation: /%original_path%/%locale%.json
|
||||||
@@ -5,6 +5,7 @@ BlitzKit is a one man band **TrèsAbhi** but I am far from solo.
|
|||||||
| Role | People |
|
| Role | People |
|
||||||
| ------------------------------ | ------------------------------ |
|
| ------------------------------ | ------------------------------ |
|
||||||
| Bot verification | S0AP |
|
| Bot verification | S0AP |
|
||||||
|
| General testing | Prince_NA |
|
||||||
| Bot advertisement platform | S0AP |
|
| Bot advertisement platform | S0AP |
|
||||||
| Bot rendering pipeline | Vovko |
|
| Bot rendering pipeline | Vovko |
|
||||||
| Game asset decompression | Maddox |
|
| Game asset decompression | Maddox |
|
||||||
@@ -12,7 +13,7 @@ BlitzKit is a one man band **TrèsAbhi** but I am far from solo.
|
|||||||
| Game file layout | Aeson |
|
| Game file layout | Aeson |
|
||||||
| 3-caliber rule edge cases | Minitelrose, ChickenMan7777 |
|
| 3-caliber rule edge cases | Minitelrose, ChickenMan7777 |
|
||||||
| Embed UX | \_34, HisRoyalFatness, Synx |
|
| Embed UX | \_34, HisRoyalFatness, Synx |
|
||||||
| Tankopedia pre-release testing | [OPTML], Aeson, \_34 |
|
| Tankopedia pre-release testing | [OPTML], Aeson, \_34, xkdkw |
|
||||||
| Website advertisement platform | Aeson |
|
| Website advertisement platform | Aeson |
|
||||||
| Compare pre-release testing | [OPTML] |
|
| Compare pre-release testing | [OPTML] |
|
||||||
| Redacted | GonnaHetzMe |
|
| Redacted | GonnaHetzMe |
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# BlitzKit 1.26.2
|
||||||
|
|
||||||
|
Two updates in a day! Why? Well, these two updates were being cooked separately in parallel and happened to have matured on the same day. Merry early Christmas!
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Highly optimized the component rerenders of the Tank Sandbox
|
||||||
|
- Implemented Google Analytics into the homepage to more accurately show the most popular tanks
|
||||||
|
- Optimized page load speeds and memory consumption by loading all data in parallel instead of sequentially
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Dynamic armor is now loaded in React Suspense to avoid race conditions
|
||||||
|
- Re-ordered cards on the home page so that it makes a little bit more sense
|
||||||
|
- The warnings section of the Tankopedia pages are now padded on the sides
|
||||||
|
- The calibers in the antagonist gun selector are now rounded correctly
|
||||||
|
- Tank class icons are now colored and sized properly again in the header
|
||||||
|
|
||||||
|
## Technical Changes
|
||||||
|
|
||||||
|
- Removed the extreme JPEG compression for the tank textures
|
||||||
|
- Buffers of the same length are now assumed to be identical when diffing lmao I hope this doesn't go wrong
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# BlitzKit 1.26.3
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- The bot now notifies you if your username/clan search query is too long or short instead of just showing a generic no results message
|
||||||
|
- Reduced the popular tanks list on the home page back to 8 tanks
|
||||||
|
- `/owned-tanks` now links to the corresponding Tankopedia pages
|
||||||
|
- Added more funky rich presence statuses
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- The website no longer crashes when turning on Static Armor mode
|
||||||
|
- `/stats` and other commands with tank filter commands now work properly once again
|
||||||
|
- The swap button in the Tankopedia pages no longer crashes switching between tech tree and non-tech tree tanks
|
||||||
|
- `/owned-tanks` and `/auction` now chunk text better to meet Discord's 2000 character limit
|
||||||
|
- Tanks with fixes camouflages like the M60 no longer have the option to disable the camouflage of in the Compare tool
|
||||||
|
- The pointer cursor and underscore once again appear now in the tank search in the Compare tool
|
||||||
|
- Opaque mode in the Dynamic armor mode once again works instantly
|
||||||
|
- The rich presence/status/bio of the bot once again counts all servers instead of just the ones the single shard is responsible for
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# BlitzKit 1.26.4
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- `/auction` now warns if a tank stock is at or below 500 and now strikes through the tank name if its out
|
||||||
|
- Added advanced armor highlighting mode
|
||||||
|
- Green: penetration
|
||||||
|
- Red: blocked
|
||||||
|
- Pink: ricochet
|
||||||
|
- Cyan: penetration with 3 calibers rule
|
||||||
|
- Optimized the armor highlighting for about a 15% increase in frame rate
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Added 5000 doses of adrenaline, incase the BOT DECIDES TO DIE AGAIN FOR NO REASON
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# BlitzKit 1.26.5
|
||||||
|
|
||||||
|
¡Ahora en 6 idiomas! This version of BlitzKit adds support for 4 new languages totalling up to 6! [Please help translate on Crowdin](https://crowdin.com/project/blitzkrieg).
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added Croatian, Russian, Ukrainian, and Chinese
|
||||||
|
- Pre-existing languages: English, Spanish
|
||||||
|
- Added better lighting making tanks a little less yellow and a bit more realistic
|
||||||
|
- Added custom tank icons (some may be missing when the update drops; just give them an hour or so to update)
|
||||||
|
- Increased the maximum recently viewed tanks list size to 14
|
||||||
|
- Tweaked the tank name in the hero section of the Tankopedia to allow the tank to be in the center of the page
|
||||||
|
- The headers in the Performance tool are now sticky just like the Compare tool
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Removed unnecessary third party script that did absolutely nothing
|
||||||
|
- Localizations are now stricter in what they allow, reducing errors in the Discord bot
|
||||||
|
- Added 50 gallons of tomato soup to the bot in an attempt to keep it alive
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# BlitzKit 1.26.6
|
||||||
|
|
||||||
|
This update only affects the website.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added an option to hide the tank model beneath the armor
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- 3RC is now only display when it is used to avoid a ricochet in the advanced armor highlighting mode
|
||||||
|
- Fixed the excessively sharp lighting in static mode
|
||||||
|
- Brightness for non-PBR tanks is a bit better now
|
||||||
|
- Decimal places are now properly rounded in BlitzKit link embeds
|
||||||
|
- The titles in the Tankopedia pages aren't too massive now
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# BlitzKit 1.27.0
|
||||||
|
|
||||||
|
PLEASE HELP TRANSLATE BLITZKIT: https://crowdin.com/project/blitzkrieg
|
||||||
|
|
||||||
|
This update will be the last major update before the release of World of Tanks Blitz Unreal Engine.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added support for English, Spanish, French, Japanese, Polish, Portuguese, Russian, Ukrainian, and Chinese to the website and bot
|
||||||
|
- You can switch languages through the home page, the footer of any page, or the settings page
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Fixed the units for shell capacity
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# BlitzKit 1.27.1
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Fixed a crash that occurs if tanks are deleted in Blitz and were once available in BlitzKit
|
||||||
|
- All tank icons are now back
|
||||||
|
- The tank search once again returns results
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# BlitzKit 1.27.10
|
||||||
|
|
||||||
|
This update changes the URLs across the whole website, removing the "tools" prefix and simplifying other aspects too.
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Removed "full" tank names
|
||||||
|
- For example, tanks like the "Carro 45t" had full names like "Carro Combattimento 45t" which remained pretty much unused, so they have been removed
|
||||||
|
- Reduced the shadow below the navigation bar
|
||||||
|
- Removed the "tools" prefix from the URLs; here are the paths:
|
||||||
|
- `/tools/tankopedia` -> `/tanks`
|
||||||
|
- `/tools/tankopedia/12345` -> `/tanks/tank-name`
|
||||||
|
- `/tools/compare` -> `/compare`
|
||||||
|
- `/tools/embed` -> `/embed`
|
||||||
|
- `/tools/embed/embed-name` -> `/embed/embed-name`
|
||||||
|
- `/tools/gallery` -> `/gallery`
|
||||||
|
- `/tools/performance` -> `/performance`
|
||||||
|
- `/tools/session` -> `/session`
|
||||||
|
- `/tools/tier-list` -> `/tier-list`
|
||||||
|
|
||||||
|
## Technical Features
|
||||||
|
|
||||||
|
- The asset mangler now uses http headers and even more heuristics to minimize re-creating unchanged assets
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# BlitzKit 1.27.11
|
||||||
|
|
||||||
|
This update affects both the bot and the website.
|
||||||
|
|
||||||
|
## Technical Changes
|
||||||
|
|
||||||
|
- Added a proper CDN domain to avoid error 429s and any slowdowns
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# BlitzKit 1.27.12
|
||||||
|
|
||||||
|
This update only affects the website.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added the ability to sort by HE shell penetration
|
||||||
|
- The Tankopedia compare bars now account for equipment and selected shells
|
||||||
|
- Made the hero section of the Tankopedia a bit shorter to show users that the page is scrollable
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- The "Clear filters" button no longer shows up after clearing the search bar
|
||||||
|
- Guns for some tanks no longer go transparent when far away from the camera
|
||||||
|
- The dynamic armor tab no longer lags and flickers when rotating the turret of a tank
|
||||||
|
- Reimplemented the missing tool backgrounds in the navigation bar hamburger menu
|
||||||
|
- The navigation bar now properly goes transparent for pages that request like the Tankopedia pages
|
||||||
|
- Removed the tank name text outline because it doesn't work on most devices
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# BlitzKit 1.27.13
|
||||||
|
|
||||||
|
This update adds a feature for a future version of WoTB 👁️👃👁️
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added compatibility for the new mechanic for the upcoming Polish Tank Destroyers
|
||||||
|
- This code will remain dormant until the update for WoTB is released
|
||||||
|
- Added a progress bar to the hero section of the Tankopedia to show that the model is loading
|
||||||
|
- Reordered some Tankopedia statistics to bring important statistics like Damage to the very top
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- The second column in the footer is now aligned on mobile devices
|
||||||
|
- Fixed an issue that stopped the armor highlighting from working on the Kiwi browser and on older devices
|
||||||
|
|
||||||
|
## Technical Changes
|
||||||
|
|
||||||
|
- Removed permissions for robots to crawl non-blitzkit.app domains
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# BlitzKit 1.27.14
|
||||||
|
|
||||||
|
This is the 14th patch for `1.27`, making it the new longest lasting version beating the previous record of `1.15.13`!
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Optimized the rendering of the shells in the Tankopedia search
|
||||||
|
- The Assault Shells cursor now works on iOS devices
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# BlitzKit 1.27.15
|
||||||
|
|
||||||
|
I did not see this coming
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- The Assault Shell graph now supports damage factors of above 100% now
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# BlitzKit 1.27.2
|
||||||
|
|
||||||
|
This update only affects the website.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- The new Improved Vertical Stabilizer equipment which only affects the gun depression found on the Type 63 now works
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# BlitzKit 1.27.3
|
||||||
|
|
||||||
|
This update only affects the bot.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Added support for 64-bit IDs allowing users with new accounts to link with BlitzKit
|
||||||
|
- This comes at the added cost of resetting the links of all other accounts
|
||||||
|
- Just re-link and you're good to go
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# FreakKit 1.27.4
|
||||||
|
|
||||||
|
It has come to our attention that tanks are very harsh objects. To even it out, we made the website a pretty pretty princess <3
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# BlitzKit 1.27.5
|
||||||
|
|
||||||
|
This update only affects the bot.
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Removed `/auction`
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Fixed a bug that caused `/rating` to disappear
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# BlitzKit 1.27.6
|
||||||
|
|
||||||
|
This update only affects the website.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added a promotional card for [the official Discord server](https://discord.gg/nDt7AjGJQH) to the homepage
|
||||||
|
- Added a better navbar
|
||||||
|
- The added spaces and padding helps add more room for error when clicking, especially on mobile
|
||||||
|
- The dropdown menu is now a lost smaller, disposing of the need to scroll at all
|
||||||
|
- Added shell filters to the tank search
|
||||||
|
- Reworked the filter buttons and their positions to allow for more space
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Moved most images from imgur to BlitzKit allowing for users in certain countries to load BlitzKit without getting blocked
|
||||||
|
|
||||||
|
## Technical Features
|
||||||
|
|
||||||
|
- Added Partytown to offload some workload off the main thread, allowing for a more responsive experience
|
||||||
|
- Reworked `robots.txt` to disallow indexing of BlitzKit variants
|
||||||
|
- Improved the SEO further for most pages
|
||||||
|
- Added a few compressor library to speed up load times
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# BlitzKit 1.27.7
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
This update only affects the website.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added a new foggy-wireframe transition between tabs to smooth out the jarring jumps
|
||||||
|
- Added animations pop-in and out animations on a few elements
|
||||||
|
- The tank name title now shrinks in size as soon as a disturbance is caused
|
||||||
|
- The shell selector, antagonist switcher, and thicknesses range now ease into frame
|
||||||
|
- The Tankopedia search page now loads as a skeleton by default before populating with tanks, allowing for the recently viewed tanks to load without cumulative shift
|
||||||
|
- Something similar was done to the Gallery tool
|
||||||
|
- Gave the meta section of the website some zest with nation-based backdrops
|
||||||
|
- The compare tabs in the Tankopedia are now centered
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- The camera no longer snaps to the initial position when switching between tabs
|
||||||
|
|
||||||
|
## Technical Changes
|
||||||
|
|
||||||
|
- Backported some technologies from BlitzKit Reforged; you will not notice any differences in usage
|
||||||
|
- The popular tanks and gallery indexings have been moved to the asynchronous cron job
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# BlitzKit 1.27.8
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- The website now uses Inter as the font
|
||||||
|
- Added a cool new non-disturbed state for the Tankopedia because why not
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Removed the Discord plug and language changer from the homepage
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# BlitzKit 1.27.9
|
||||||
|
|
||||||
|
BlitzKit's great, but there's far too many numbers. This update adds a few visualizers to help new players understand how things relate numerically.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added the turret and hull traverse speed visualizer
|
||||||
|
- Added the shell ricochet and normalization angles visualizer
|
||||||
|
- Added the view-range visualizer
|
||||||
|
- Added a search bar to the Tankopedia characteristics
|
||||||
|
- Bumped the decimal places for vehicle dimensions and volume
|
||||||
|
- Made tank ranks softer (the bars beneath the tank characteristics)
|
||||||
|
- Gave the navigation bar better distinction from the rest of the page
|
||||||
|
- Increased the number of characteristics rows to 3 on select devices
|
||||||
|
- Switched to a more contrasting classic style of components across the website (it's subtle, but beautiful)
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Removed units
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Clarified a few confusing row labels in the Compare tool
|
||||||
|
- Made the Tankopedia hero section dynamically smaller on mobile phones to allow scrolling
|
||||||
|
- Tank ranks no longer reach 0 or go above the number of vehicles in the comparison
|
||||||
+13
-14
@@ -1,18 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkit",
|
"name": "blitzkit",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.26.1",
|
"version": "1.27.15",
|
||||||
"description": "🎉 Tools for everything World of Tanks Blitz",
|
"description": "🎉 Tools for everything World of Tanks Blitz",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"types": "./types.d.ts",
|
"types": "./types.d.ts",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*",
|
||||||
|
"submodules/*"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:assets": "cd packages/scripts && bun run build:assets",
|
"build:assets": "cd packages/scripts && bun run build:assets",
|
||||||
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
|
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
|
||||||
"build:bot": "cd packages/scripts && bun run build:bot",
|
"build:bot": "cd packages/scripts && bun run build:bot",
|
||||||
"build:website": "bun build:prisma --no-hints && cd packages/website && bun run build",
|
"build:website": "cd packages/website-ue && bun run build",
|
||||||
"build:prisma": "prisma generate",
|
"build:prisma": "prisma generate",
|
||||||
"build:sitemap": "bun scripts/sitemap.ts",
|
"build:sitemap": "bun scripts/sitemap.ts",
|
||||||
"build:docs": "vitepress build docs",
|
"build:docs": "vitepress build docs",
|
||||||
@@ -21,6 +22,7 @@
|
|||||||
"start:bot": "bun dist/bot/main.js",
|
"start:bot": "bun dist/bot/main.js",
|
||||||
"dev:docs": "vitepress dev docs",
|
"dev:docs": "vitepress dev docs",
|
||||||
"dev:website": "cd packages/website && bun run dev",
|
"dev:website": "cd packages/website && bun run dev",
|
||||||
|
"dev": "bun run dev:website",
|
||||||
"dev:api": "bun --filter=@blitzkit/api run dev",
|
"dev:api": "bun --filter=@blitzkit/api run dev",
|
||||||
"setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader",
|
"setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader",
|
||||||
"setup:patches": "bun --filter=@blitzkit/scripts run setup:patches",
|
"setup:patches": "bun --filter=@blitzkit/scripts run setup:patches",
|
||||||
@@ -29,24 +31,21 @@
|
|||||||
"lint": "tsc",
|
"lint": "tsc",
|
||||||
"lint:website": "cd packages/website && bun run lint",
|
"lint:website": "cd packages/website && bun run lint",
|
||||||
"format": "prettier --write \"**/*.@(json|js|jsx|css|md|ts|tsx|html|xml|yml|gltf)\"",
|
"format": "prettier --write \"**/*.@(json|js|jsx|css|md|ts|tsx|html|xml|yml|gltf)\"",
|
||||||
"update": "yarn upgrade --latest",
|
"update": "yarn upgace --latest",
|
||||||
"tunnel": "cloudflared tunnel --url http://localhost:3000",
|
"tunnel": "cloudflared tunnel --url http://localhost:3000",
|
||||||
"discoverids": "scripts/discoverIds.ts",
|
"discoverids": "scripts/discoverIds.ts",
|
||||||
"build:protos": "bun packages/scripts/src/protos.ts",
|
"build:protos": "bun packages/scripts/src/protos.ts",
|
||||||
"preview:website": "cd packages/website && bun run preview",
|
"preview:website": "cd packages/website && bun run preview",
|
||||||
"build:reviews": "cd packages/scripts && bun build:reviews",
|
"build:reviews": "cd packages/scripts && bun build:reviews",
|
||||||
"build:ids": "cd packages/scripts && bun build:ids"
|
"build:ids": "cd packages/scripts && bun build:ids",
|
||||||
|
"prunestrings": "cd packages/scripts && bun prunestrings",
|
||||||
|
"build:ffi": "bun build:windows:ffi",
|
||||||
|
"build:windows:ffi": "dotnet publish src/BlitzKit.FFI -r win-x64 /p:PublishAot=true",
|
||||||
|
"build:linux:ffi": "dotnet publish src/BlitzKit.FFI -r linux-x64 /p:PublishAot=true"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lodash-es": "^4.17.21"
|
"@types/bun": "^1.2.15",
|
||||||
},
|
"prettier": "^3.5.3"
|
||||||
"devDependencies": {
|
|
||||||
"@types/bun": "latest",
|
|
||||||
"@types/lodash-es": "^4.17.12",
|
|
||||||
"@types/node": "^22.5.4",
|
|
||||||
"prettier": "^3.3.3",
|
|
||||||
"prisma": "^6.0.0",
|
|
||||||
"typescript": "^5.5.4"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,23 +3,8 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"types": "src/types.d.ts",
|
"types": "src/types.d.ts",
|
||||||
"dependencies": {
|
|
||||||
"@blitzkit/core": "workspace:*",
|
|
||||||
"satori": "^0.10.14",
|
|
||||||
"@resvg/resvg-js": "^2.6.2",
|
|
||||||
"discord.js": "^14.16.3",
|
|
||||||
"react": "^18.3.1",
|
|
||||||
"@radix-ui/colors": "^3.0.0",
|
|
||||||
"fuzzysort": "^2.0.4",
|
|
||||||
"bepaint": "^0.1.0-beta.3",
|
|
||||||
"dotenv": "^16.4.5",
|
|
||||||
"markdown-escape": "^2.0.0"
|
|
||||||
},
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "bun --watch src/main.ts",
|
"dev": "bun --watch src/main.ts",
|
||||||
"start": "bun src/main.ts"
|
"start": "bun src/main.ts"
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/markdown-escape": "^1.1.3"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,10 +28,10 @@ export const aboutCommand = new Promise<CommandRegistry>(async (resolve) => {
|
|||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const subcommand = interaction.options.getSubcommand();
|
const subcommand = interaction.options.getSubcommand();
|
||||||
const { t } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
|
|
||||||
if (subcommand === 'commands') {
|
if (subcommand === 'commands') {
|
||||||
return t`bot.commands.about.subcommands.commands.body${(
|
return `${strings.bot.commands.about.subcommands.commands.body}${(
|
||||||
await Promise.all(COMMANDS_RAW)
|
await Promise.all(COMMANDS_RAW)
|
||||||
)
|
)
|
||||||
.sort((a, b) =>
|
.sort((a, b) =>
|
||||||
|
|||||||
@@ -3,16 +3,18 @@ import {
|
|||||||
Region,
|
Region,
|
||||||
regionToRegionSubdomain,
|
regionToRegionSubdomain,
|
||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { tankDefinitions } from '../core/blitzkit/nonBlockingPromises';
|
import { tankDefinitions } from '../core/blitzkit/nonBlockingPromises';
|
||||||
|
import { chunkLines } from '../core/discord/chunkLines';
|
||||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
||||||
import { translator } from '../core/localization/translator';
|
import { translator } from '../core/localization/translator';
|
||||||
import { CommandRegistry } from '../events/interactionCreate';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
|
|
||||||
interface Auction {
|
type Auction = null | {
|
||||||
count: number;
|
count: number;
|
||||||
has_next: boolean;
|
has_next: boolean;
|
||||||
results: Result[];
|
results: Result[];
|
||||||
}
|
};
|
||||||
|
|
||||||
type Result =
|
type Result =
|
||||||
| {
|
| {
|
||||||
@@ -20,13 +22,13 @@ type Result =
|
|||||||
type: 'vehicle';
|
type: 'vehicle';
|
||||||
countable?: boolean;
|
countable?: boolean;
|
||||||
entity?: Entity;
|
entity?: Entity;
|
||||||
initial_count?: number;
|
initial_count: number;
|
||||||
current_count?: number;
|
current_count: number;
|
||||||
saleable?: boolean;
|
saleable?: boolean;
|
||||||
available_from?: Date;
|
available_from?: Date;
|
||||||
available_before?: Date;
|
available_before?: Date;
|
||||||
price?: Price;
|
price?: Price;
|
||||||
next_price?: Price | null;
|
next_price: Price | null;
|
||||||
available: true;
|
available: true;
|
||||||
display?: boolean;
|
display?: boolean;
|
||||||
next_price_datetime: Date;
|
next_price_datetime: Date;
|
||||||
@@ -67,12 +69,14 @@ interface Currency {
|
|||||||
type: 'currency';
|
type: 'currency';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const WARNING_COUNT = 500;
|
||||||
|
|
||||||
export const auctionCommand = new Promise<CommandRegistry>((resolve) => {
|
export const auctionCommand = new Promise<CommandRegistry>((resolve) => {
|
||||||
resolve({
|
resolve({
|
||||||
command: createLocalizedCommand('auction'),
|
command: createLocalizedCommand('auction'),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const { t, translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const awaitedTankDefinitions = await tankDefinitions;
|
const awaitedTankDefinitions = await tankDefinitions;
|
||||||
const region: Region = 'com';
|
const region: Region = 'com';
|
||||||
const pageSize = 80;
|
const pageSize = 80;
|
||||||
@@ -84,45 +88,57 @@ export const auctionCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
pageSize
|
pageSize
|
||||||
}&type[]=vehicle&saleable=${saleable}`,
|
}&type[]=vehicle&saleable=${saleable}`,
|
||||||
).then((response) => response.json() as Promise<Auction>);
|
).then((response) => response.json() as Promise<Auction>);
|
||||||
const saleableTanks = data.results.filter((result) => result.available);
|
|
||||||
|
|
||||||
if (saleableTanks.length === 0) {
|
if (data === null) {
|
||||||
return t`bot.commands.auction.errors.no_auction`;
|
return strings.bot.commands.auction.errors.no_auction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const saleableTanks = data.results.filter((result) => result.available);
|
||||||
const nextPricesTimestamp = saleableTanks[0].next_price_timestamp;
|
const nextPricesTimestamp = saleableTanks[0].next_price_timestamp;
|
||||||
|
|
||||||
const title = `# ${t`bot.commands.auction.body.title`}`;
|
const title = `# ${strings.bot.commands.auction.body.title}`;
|
||||||
const subtitle = `${translate('bot.commands.auction.body.subtitle', [
|
const subtitle = `${literals(strings.bot.commands.auction.body.subtitle, [
|
||||||
`${saleableTanks.length} / ${data.results.length}`,
|
`${saleableTanks.length} / ${data.results.length}`,
|
||||||
`<t:${nextPricesTimestamp}:R>`,
|
`<t:${nextPricesTimestamp}:R>`,
|
||||||
'<https://wotblitz.com/auction/>',
|
'<https://wotblitz.com/auction/>',
|
||||||
])}`;
|
])}`;
|
||||||
const body = saleableTanks
|
const body = saleableTanks.map((data, index) => {
|
||||||
.map((data, index) => {
|
const tank = awaitedTankDefinitions.tanks[data.entity!.id];
|
||||||
const tank = awaitedTankDefinitions.tanks[data.entity!.id];
|
|
||||||
|
|
||||||
if (!tank) return '';
|
if (!tank) return '';
|
||||||
|
|
||||||
const name = `[${tank.name}](<https://blitzkit.app/tools/tankopedia/${
|
const name = `[${tank.name}](<https://blitzkit.app/tanks/${
|
||||||
tank.id
|
tank.slug
|
||||||
}>)`;
|
}>)`;
|
||||||
const next = translate('bot.commands.auction.body.next', [
|
const next =
|
||||||
`<:gold:1317173197082333244> ${data.next_price!.value.toLocaleString(
|
data.next_price === null
|
||||||
interaction.locale,
|
? ''
|
||||||
)}`,
|
: `\n-# ${literals(strings.bot.commands.auction.body.next, [
|
||||||
]);
|
`<:gold:1317173197082333244> ${data.next_price.value.toLocaleString(
|
||||||
|
interaction.locale,
|
||||||
|
)}`,
|
||||||
|
])}`;
|
||||||
|
const available = literals(
|
||||||
|
strings.bot.commands.auction.body.available,
|
||||||
|
[
|
||||||
|
data.current_count.toLocaleString(interaction.locale),
|
||||||
|
data.initial_count.toLocaleString(interaction.locale),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
const isOut = data.current_count === 0;
|
||||||
|
const outString = isOut ? '~~' : '';
|
||||||
|
const isLow = data.current_count <= WARNING_COUNT;
|
||||||
|
|
||||||
return `${
|
return `${index + 1}. ${
|
||||||
index + 1
|
outString
|
||||||
}. ${name} <:gold:1317173197082333244> ${data.price!.value.toLocaleString(
|
}${name} <:gold:1317173197082333244> ${data.price!.value.toLocaleString(
|
||||||
interaction.locale,
|
interaction.locale,
|
||||||
)}\n-# ${next}`;
|
)}${outString}\n-#${isLow ? ' ‼️ ' : ' '}${available}${isOut ? '' : next}`;
|
||||||
})
|
});
|
||||||
.join('\n\n');
|
const header = `${title}\n${subtitle}`;
|
||||||
const content = `${title}\n${subtitle}\n\n${body}`;
|
const lines = [header, ...body];
|
||||||
|
|
||||||
return content;
|
return chunkLines(lines, '\n\n');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
getWN8Percentile,
|
getWN8Percentile,
|
||||||
TankDefinition,
|
TankDefinition,
|
||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { Locale } from 'discord.js';
|
import { Locale } from 'discord.js';
|
||||||
import { chunk } from 'lodash-es';
|
import { chunk } from 'lodash-es';
|
||||||
import * as Breakdown from '../../components/Breakdown';
|
import * as Breakdown from '../../components/Breakdown';
|
||||||
@@ -32,7 +33,7 @@ export async function renderBreakdown(
|
|||||||
filters: StatFilters,
|
filters: StatFilters,
|
||||||
locale: Locale,
|
locale: Locale,
|
||||||
) {
|
) {
|
||||||
const { t, translate } = translator(locale);
|
const { strings, unwrap } = translator(locale);
|
||||||
const awaitedTankDefinitions = await tankDefinitions;
|
const awaitedTankDefinitions = await tankDefinitions;
|
||||||
const awaitedTankAverages = await blitzStarsTankAverages;
|
const awaitedTankAverages = await blitzStarsTankAverages;
|
||||||
const statsInPeriod = await getStatsInPeriod(region, id, start, end, locale);
|
const statsInPeriod = await getStatsInPeriod(region, id, start, end, locale);
|
||||||
@@ -48,7 +49,7 @@ export async function renderBreakdown(
|
|||||||
const orderedCareerWN8Full: (number | undefined)[] = [];
|
const orderedCareerWN8Full: (number | undefined)[] = [];
|
||||||
|
|
||||||
if (tankStats === null) {
|
if (tankStats === null) {
|
||||||
throw new UserError(t`bot.common.errors.no_tank_stats`);
|
throw new UserError(strings.bot.common.errors.no_tank_stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredOrder.forEach((id) => {
|
filteredOrder.forEach((id) => {
|
||||||
@@ -136,21 +137,21 @@ export async function renderBreakdown(
|
|||||||
<Breakdown.Row
|
<Breakdown.Row
|
||||||
key={id}
|
key={id}
|
||||||
displayType="summary"
|
displayType="summary"
|
||||||
title={t`bot.commands.breakdown.body.total`}
|
title={strings.bot.commands.breakdown.body.total}
|
||||||
stats={[
|
stats={[
|
||||||
{
|
{
|
||||||
title: t`bot.commands.breakdown.body.battles`,
|
title: strings.bot.commands.breakdown.body.battles,
|
||||||
current: currentBattles,
|
current: currentBattles,
|
||||||
career: careerBattles,
|
career: careerBattles,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t`bot.commands.breakdown.body.winrate`,
|
title: strings.bot.commands.breakdown.body.winrate,
|
||||||
current: `${(100 * currentWinrate).toFixed(2)}%`,
|
current: `${(100 * currentWinrate).toFixed(2)}%`,
|
||||||
career: `${(100 * careerWinrate).toFixed(2)}%`,
|
career: `${(100 * careerWinrate).toFixed(2)}%`,
|
||||||
delta: currentWinrate - careerWinrate,
|
delta: currentWinrate - careerWinrate,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t`bot.commands.breakdown.body.wn8`,
|
title: strings.bot.commands.breakdown.body.wn8,
|
||||||
current:
|
current:
|
||||||
currentWN8 === undefined
|
currentWN8 === undefined
|
||||||
? undefined
|
? undefined
|
||||||
@@ -165,7 +166,7 @@ export async function renderBreakdown(
|
|||||||
: getWN8Percentile(currentWN8),
|
: getWN8Percentile(currentWN8),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t`bot.commands.breakdown.body.damage`,
|
title: strings.bot.commands.breakdown.body.damage,
|
||||||
current: Math.round(currentDamage).toLocaleString(),
|
current: Math.round(currentDamage).toLocaleString(),
|
||||||
career: Math.round(careerDamage).toLocaleString(),
|
career: Math.round(careerDamage).toLocaleString(),
|
||||||
delta: currentDamage - careerDamage,
|
delta: currentDamage - careerDamage,
|
||||||
@@ -190,17 +191,20 @@ export async function renderBreakdown(
|
|||||||
class={tankDefinition?.class}
|
class={tankDefinition?.class}
|
||||||
type={tankDefinition?.type}
|
type={tankDefinition?.type}
|
||||||
title={
|
title={
|
||||||
tankDefinition?.name ??
|
tankDefinition
|
||||||
translate('bot.commands.breakdown.body.unknown_tank', [`${id}`])
|
? unwrap(tankDefinition.name)
|
||||||
|
: literals(strings.bot.commands.breakdown.body.unknown_tank, [
|
||||||
|
`${id}`,
|
||||||
|
])
|
||||||
}
|
}
|
||||||
stats={[
|
stats={[
|
||||||
{
|
{
|
||||||
title: t`bot.commands.breakdown.body.battles`,
|
title: strings.bot.commands.breakdown.body.battles,
|
||||||
current: current.battles.toLocaleString(),
|
current: current.battles.toLocaleString(),
|
||||||
career: career.battles.toLocaleString(),
|
career: career.battles.toLocaleString(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t`bot.commands.breakdown.body.winrate`,
|
title: strings.bot.commands.breakdown.body.winrate,
|
||||||
current: `${(100 * (current.wins / current.battles)).toFixed(
|
current: `${(100 * (current.wins / current.battles)).toFixed(
|
||||||
2,
|
2,
|
||||||
)}%`,
|
)}%`,
|
||||||
@@ -209,7 +213,7 @@ export async function renderBreakdown(
|
|||||||
current.wins / current.battles - career.wins / career.battles,
|
current.wins / current.battles - career.wins / career.battles,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t`bot.commands.breakdown.body.wn8`,
|
title: strings.bot.commands.breakdown.body.wn8,
|
||||||
current:
|
current:
|
||||||
currentWN8 === undefined
|
currentWN8 === undefined
|
||||||
? undefined
|
? undefined
|
||||||
@@ -224,7 +228,7 @@ export async function renderBreakdown(
|
|||||||
: getWN8Percentile(currentWN8),
|
: getWN8Percentile(currentWN8),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t`bot.commands.breakdown.body.damage`,
|
title: strings.bot.commands.breakdown.body.damage,
|
||||||
current: Math.round(
|
current: Math.round(
|
||||||
current.damage_dealt / current.battles,
|
current.damage_dealt / current.battles,
|
||||||
).toLocaleString(),
|
).toLocaleString(),
|
||||||
|
|||||||
@@ -11,17 +11,17 @@ export const debugCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
command: createLocalizedCommand('debug'),
|
command: createLocalizedCommand('debug'),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const { t } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const currentTime = new Date().getTime();
|
const currentTime = new Date().getTime();
|
||||||
const uptime = currentTime - executionStart;
|
const uptime = currentTime - executionStart;
|
||||||
const list = [
|
const list = [
|
||||||
[t`bot.commands.debug.body.version`, packageJSON.version],
|
[strings.bot.commands.debug.body.version, packageJSON.version],
|
||||||
[
|
[
|
||||||
t`bot.commands.debug.body.shard`,
|
strings.bot.commands.debug.body.shard.label,
|
||||||
client.shard?.ids[0] ?? t`bot.commands.debug.body.shard.default`,
|
client.shard?.ids[0] ?? strings.bot.commands.debug.body.shard.default,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
t`bot.commands.debug.body.uptime`,
|
strings.bot.commands.debug.body.uptime,
|
||||||
`${Math.floor((uptime / 1000 / 60 / 60) % 24)}h ${Math.floor(
|
`${Math.floor((uptime / 1000 / 60 / 60) % 24)}h ${Math.floor(
|
||||||
(uptime / 1000 / 60) % 60,
|
(uptime / 1000 / 60) % 60,
|
||||||
)}m ${Math.floor((uptime / 1000) % 60)}s ${Math.floor(
|
)}m ${Math.floor((uptime / 1000) % 60)}s ${Math.floor(
|
||||||
@@ -29,7 +29,7 @@ export const debugCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
)}ms`,
|
)}ms`,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
return t`bot.commands.debug.body.title${list
|
return `${strings.bot.commands.debug.body.title}${list
|
||||||
.map(([key, value]) => `- ${key}: ${value}`)
|
.map(([key, value]) => `- ${key}: ${value}`)
|
||||||
.join('\n')}`;
|
.join('\n')}`;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { getAccountInfo, getClanInfo } from '@blitzkit/core';
|
import { getAccountInfo, getClanInfo } from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { Locale } from 'discord.js';
|
import { Locale } from 'discord.js';
|
||||||
import { CommandWrapper } from '../components/CommandWrapper';
|
import { CommandWrapper } from '../components/CommandWrapper';
|
||||||
import { GenericStats } from '../components/GenericStats';
|
import { GenericStats } from '../components/GenericStats';
|
||||||
@@ -19,26 +20,31 @@ export const inactiveCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
command: createLocalizedCommand('inactive')
|
command: createLocalizedCommand('inactive')
|
||||||
.addStringOption(addClanChoices)
|
.addStringOption(addClanChoices)
|
||||||
.addNumberOption((option) => {
|
.addNumberOption((option) => {
|
||||||
const { translate } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
return option
|
return option
|
||||||
.setName('threshold')
|
.setName('threshold')
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject('bot.commands.inactive.options.threshold'),
|
localizationObject(
|
||||||
|
(strings) => strings.bot.commands.inactive.options.threshold.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
translate('bot.commands.inactive.options.threshold.description'),
|
strings.bot.commands.inactive.options.threshold.description,
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.commands.inactive.options.threshold.description',
|
(strings) =>
|
||||||
|
strings.bot.commands.inactive.options.threshold.description,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.setMinValue(0);
|
.setMinValue(0);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const { translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const { region, id } = await resolveClanFromCommand(interaction);
|
const { region, id } = await resolveClanFromCommand(interaction);
|
||||||
const threshold =
|
const threshold =
|
||||||
interaction.options.getNumber('threshold')! ?? DEFAULT_THRESHOLD;
|
interaction.options.getNumber('threshold')! ?? DEFAULT_THRESHOLD;
|
||||||
@@ -59,7 +65,7 @@ export const inactiveCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
([name, days]) =>
|
([name, days]) =>
|
||||||
[
|
[
|
||||||
name,
|
name,
|
||||||
translate('bot.commands.inactive.body.listing', [
|
literals(strings.bot.commands.inactive.body.listing, [
|
||||||
days.toFixed(0),
|
days.toFixed(0),
|
||||||
]),
|
]),
|
||||||
] as [string, string],
|
] as [string, string],
|
||||||
@@ -71,9 +77,10 @@ export const inactiveCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
<TitleBar
|
<TitleBar
|
||||||
title={clanInfo.name}
|
title={clanInfo.name}
|
||||||
image={`https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${clanInfo.emblem_set_id}.png`}
|
image={`https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${clanInfo.emblem_set_id}.png`}
|
||||||
description={`${translate('bot.commands.inactive.body.subtitle', [
|
description={`${literals(
|
||||||
`${threshold}`,
|
strings.bot.commands.inactive.body.subtitle,
|
||||||
])} • ${new Date().toLocaleDateString(interaction.locale)}`}
|
[`${threshold}`],
|
||||||
|
)} • ${new Date().toLocaleDateString(interaction.locale)}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{!hasInactiveMembers && (
|
{!hasInactiveMembers && (
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
import {
|
import { getAccountInfo, getClanAccountInfo } from '@blitzkit/core';
|
||||||
getAccountInfo,
|
|
||||||
getClanAccountInfo,
|
|
||||||
linkBlitzAndDiscord,
|
|
||||||
} from '@blitzkit/core';
|
|
||||||
import { teal } from '@radix-ui/colors';
|
import { teal } from '@radix-ui/colors';
|
||||||
import { Glow } from '../components/AllStatsOverview/components/HeroStat/components/Glow';
|
import { Glow } from '../components/AllStatsOverview/components/HeroStat/components/Glow';
|
||||||
import { CommandWrapper } from '../components/CommandWrapper';
|
import { CommandWrapper } from '../components/CommandWrapper';
|
||||||
|
import { linkBlitzAndDiscord } from '../core/db/linkBlitzAndDiscord';
|
||||||
import { addUsernameChoices } from '../core/discord/addUsernameChoices';
|
import { addUsernameChoices } from '../core/discord/addUsernameChoices';
|
||||||
import { autocompleteUsername } from '../core/discord/autocompleteUsername';
|
import { autocompleteUsername } from '../core/discord/autocompleteUsername';
|
||||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
||||||
@@ -22,7 +19,7 @@ export const verifyCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
),
|
),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const { t, translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const { id, region } = await resolvePlayerFromCommand(interaction);
|
const { id, region } = await resolvePlayerFromCommand(interaction);
|
||||||
const discordId = BigInt(interaction.user.id);
|
const discordId = BigInt(interaction.user.id);
|
||||||
const accountInfo = await getAccountInfo(region, id);
|
const accountInfo = await getAccountInfo(region, id);
|
||||||
@@ -120,9 +117,9 @@ export const verifyCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
height: 16,
|
height: 16,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<span
|
<span style={{ fontSize: 16 }}>
|
||||||
style={{ fontSize: 16 }}
|
{strings.bot.commands.link.body.accounts_linked}
|
||||||
>{t`bot.commands.link.body.accounts_linked`}</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@@ -174,7 +171,7 @@ export const verifyCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
{clanAccountInfo?.clan
|
{clanAccountInfo?.clan
|
||||||
? `[${clanAccountInfo?.clan?.tag}] • `
|
? `[${clanAccountInfo?.clan?.tag}] • `
|
||||||
: ''}
|
: ''}
|
||||||
{translate(`common.regions.normal.${region}`)}
|
{strings.common.regions.normal[region]}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -185,8 +182,8 @@ export const verifyCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
</CommandWrapper>,
|
</CommandWrapper>,
|
||||||
|
|
||||||
embedInfo(
|
embedInfo(
|
||||||
t`bot.commands.link.embed.title`,
|
strings.bot.commands.link.embed.title,
|
||||||
t`bot.commands.link.embed.description`,
|
strings.bot.commands.link.embed.description,
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
getAccountInfo,
|
getAccountInfo,
|
||||||
getTankStats,
|
getTankStats,
|
||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
import { chunk } from 'lodash-es';
|
import { literals } from '@blitzkit/i18n';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import {
|
import {
|
||||||
gameDefinitions,
|
gameDefinitions,
|
||||||
@@ -15,13 +15,12 @@ import {
|
|||||||
import { addTierChoices } from '../core/discord/addTierChoices';
|
import { addTierChoices } from '../core/discord/addTierChoices';
|
||||||
import { addUsernameChoices } from '../core/discord/addUsernameChoices';
|
import { addUsernameChoices } from '../core/discord/addUsernameChoices';
|
||||||
import { autocompleteUsername } from '../core/discord/autocompleteUsername';
|
import { autocompleteUsername } from '../core/discord/autocompleteUsername';
|
||||||
|
import { chunkLines } from '../core/discord/chunkLines';
|
||||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
||||||
import { resolvePlayerFromCommand } from '../core/discord/resolvePlayerFromCommand';
|
import { resolvePlayerFromCommand } from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { translator } from '../core/localization/translator';
|
import { translator } from '../core/localization/translator';
|
||||||
import { CommandRegistry } from '../events/interactionCreate';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
|
|
||||||
const TANKS_PER_MESSAGE = 64;
|
|
||||||
|
|
||||||
export const ownedTanksCommand = new Promise<CommandRegistry>((resolve) => {
|
export const ownedTanksCommand = new Promise<CommandRegistry>((resolve) => {
|
||||||
resolve({
|
resolve({
|
||||||
command: createLocalizedCommand('owned-tanks')
|
command: createLocalizedCommand('owned-tanks')
|
||||||
@@ -29,14 +28,14 @@ export const ownedTanksCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
.addStringOption(addUsernameChoices),
|
.addStringOption(addUsernameChoices),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const { t, translate } = translator(interaction.locale);
|
const { strings, unwrap } = translator(interaction.locale);
|
||||||
const tier = Number(interaction.options.getString('tier'));
|
const tier = Number(interaction.options.getString('tier'));
|
||||||
const { id, region } = await resolvePlayerFromCommand(interaction);
|
const { id, region } = await resolvePlayerFromCommand(interaction);
|
||||||
const accountInfo = await getAccountInfo(region, id);
|
const accountInfo = await getAccountInfo(region, id);
|
||||||
const tankStats = await getTankStats(region, id);
|
const tankStats = await getTankStats(region, id);
|
||||||
|
|
||||||
if (tankStats === null) {
|
if (tankStats === null) {
|
||||||
return t`bot.common.errors.no_tank_stats`;
|
return strings.bot.common.errors.no_tank_stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
const filteredTanks = (
|
const filteredTanks = (
|
||||||
@@ -61,7 +60,11 @@ export const ownedTanksCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
|
|
||||||
const awaitedTankDefinitions = await tankDefinitions;
|
const awaitedTankDefinitions = await tankDefinitions;
|
||||||
const awaitedGameDefinitions = await gameDefinitions;
|
const awaitedGameDefinitions = await gameDefinitions;
|
||||||
const lines = tankStats
|
const title = literals(strings.bot.commands.owned_tanks.body.title, [
|
||||||
|
markdownEscape(accountInfo.nickname),
|
||||||
|
TIER_ROMAN_NUMERALS[tier],
|
||||||
|
]);
|
||||||
|
const tankList = tankStats
|
||||||
.map(({ tank_id }) => awaitedTankDefinitions.tanks[tank_id])
|
.map(({ tank_id }) => awaitedTankDefinitions.tanks[tank_id])
|
||||||
.filter((tank) => tank.tier === tier)
|
.filter((tank) => tank.tier === tier)
|
||||||
.sort(
|
.sort(
|
||||||
@@ -73,16 +76,13 @@ export const ownedTanksCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
awaitedGameDefinitions.nations.indexOf(a.nation) -
|
awaitedGameDefinitions.nations.indexOf(a.nation) -
|
||||||
awaitedGameDefinitions.nations.indexOf(b.nation),
|
awaitedGameDefinitions.nations.indexOf(b.nation),
|
||||||
)
|
)
|
||||||
.map((tank) => `${flags[tank.nation]} ${markdownEscape(tank.name)}`);
|
.map(
|
||||||
|
(tank) =>
|
||||||
|
`[${flags[tank.nation]} ${markdownEscape(unwrap(tank.name))}](<https://blitzkit.app/tanks/${tank.slug}>)`,
|
||||||
|
);
|
||||||
|
const lines = [title, ...tankList];
|
||||||
|
|
||||||
return chunk(lines, TANKS_PER_MESSAGE).map((lines, index) =>
|
return chunkLines(lines);
|
||||||
index === 0
|
|
||||||
? `${translate('bot.commands.owned_tanks.body.title', [
|
|
||||||
markdownEscape(accountInfo.nickname),
|
|
||||||
TIER_ROMAN_NUMERALS[tier],
|
|
||||||
])}${lines.join('\n')}`
|
|
||||||
: lines.join('\n'),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
autocomplete: autocompleteUsername,
|
autocomplete: autocompleteUsername,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
||||||
import { translator } from '../core/localization/translator';
|
import { translator } from '../core/localization/translator';
|
||||||
import { CommandRegistry } from '../events/interactionCreate';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
@@ -7,26 +8,26 @@ export const permissionsCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
command: createLocalizedCommand('permissions'),
|
command: createLocalizedCommand('permissions'),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const { t, translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
// friday the 13th permissions easter egg
|
// friday the 13th permissions easter egg
|
||||||
const isFridayThe13th =
|
const isFridayThe13th =
|
||||||
new Date().getDay() === 5 && new Date().getDate() === 13;
|
new Date().getDay() === 5 && new Date().getDate() === 13;
|
||||||
const permissions = [
|
const permissions = [
|
||||||
[
|
[
|
||||||
interaction.appPermissions?.has('ViewChannel'),
|
interaction.appPermissions?.has('ViewChannel'),
|
||||||
t`bot.commands.permissions.body.view_channels`,
|
strings.bot.commands.permissions.body.view_channels,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
interaction.appPermissions?.has('ReadMessageHistory'),
|
interaction.appPermissions?.has('ReadMessageHistory'),
|
||||||
t`bot.commands.permissions.body.read_message_history`,
|
strings.bot.commands.permissions.body.read_message_history,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
interaction.appPermissions?.has('AttachFiles'),
|
interaction.appPermissions?.has('AttachFiles'),
|
||||||
t`bot.commands.permissions.body.attach_files`,
|
strings.bot.commands.permissions.body.attach_files,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
interaction.appPermissions?.has('UseExternalEmojis'),
|
interaction.appPermissions?.has('UseExternalEmojis'),
|
||||||
t`bot.commands.permissions.body.external_emojis`,
|
strings.bot.commands.permissions.body.external_emojis,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
const body = permissions
|
const body = permissions
|
||||||
@@ -39,7 +40,7 @@ export const permissionsCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
})
|
})
|
||||||
.join('\n');
|
.join('\n');
|
||||||
|
|
||||||
return translate('bot.commands.permissions.body.title', [body]);
|
return literals(strings.bot.commands.permissions.body.title, [body]);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
||||||
import { translator } from '../core/localization/translator';
|
import { translator } from '../core/localization/translator';
|
||||||
import { CommandRegistry } from '../events/interactionCreate';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
@@ -12,19 +13,19 @@ export const pingCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
]),
|
]),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const { t, translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const subcommand = interaction.options.getSubcommand();
|
const subcommand = interaction.options.getSubcommand();
|
||||||
const executionStart = Date.now();
|
const executionStart = Date.now();
|
||||||
|
|
||||||
if (subcommand === 'blitzkit') {
|
if (subcommand === 'blitzkit') {
|
||||||
await interaction.editReply(t`bot.commands.ping.body.pong`);
|
await interaction.editReply(strings.bot.commands.ping.body.pong);
|
||||||
} else {
|
} else {
|
||||||
await fetch('https://api.wotblitz.com/');
|
await fetch('https://api.wotblitz.com/');
|
||||||
}
|
}
|
||||||
|
|
||||||
const executionTime = Date.now() - executionStart;
|
const executionTime = Date.now() - executionStart;
|
||||||
interaction.editReply(
|
interaction.editReply(
|
||||||
translate('bot.commands.ping.body.pong_with_time', [
|
literals(strings.bot.commands.ping.body.pong_with_time, [
|
||||||
`${Math.round(executionTime)}`,
|
`${Math.round(executionTime)}`,
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { getAccountInfo } from '@blitzkit/core';
|
import { getAccountInfo } from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import { addUsernameChoices } from '../core/discord/addUsernameChoices';
|
import { addUsernameChoices } from '../core/discord/addUsernameChoices';
|
||||||
import { autocompleteUsername } from '../core/discord/autocompleteUsername';
|
import { autocompleteUsername } from '../core/discord/autocompleteUsername';
|
||||||
@@ -15,27 +16,27 @@ export const playerInfoCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
createLocalizedCommand('player-info').addStringOption(addUsernameChoices),
|
createLocalizedCommand('player-info').addStringOption(addUsernameChoices),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const { t, translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const account = await resolvePlayerFromCommand(interaction);
|
const account = await resolvePlayerFromCommand(interaction);
|
||||||
const { id, region: region } = account;
|
const { id, region: region } = account;
|
||||||
const accountInfo = await getAccountInfo(region, id);
|
const accountInfo = await getAccountInfo(region, id);
|
||||||
|
|
||||||
return embedInfo(
|
return embedInfo(
|
||||||
translate('bot.commands.player_info.body.title', [
|
literals(strings.bot.commands.player_info.body.title, [
|
||||||
markdownEscape(accountInfo.nickname),
|
markdownEscape(accountInfo.nickname),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
markdownTable([
|
markdownTable([
|
||||||
[
|
[
|
||||||
t`bot.commands.player_info.body.nickname`,
|
strings.bot.commands.player_info.body.nickname,
|
||||||
`${accountInfo.nickname}`,
|
`${accountInfo.nickname}`,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
t`bot.commands.player_info.body.battles`,
|
strings.bot.commands.player_info.body.battles,
|
||||||
`${accountInfo.statistics.all.battles}`,
|
`${accountInfo.statistics.all.battles}`,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
t`bot.commands.player_info.body.winrate`,
|
strings.bot.commands.player_info.body.winrate,
|
||||||
`${(
|
`${(
|
||||||
100 *
|
100 *
|
||||||
(accountInfo.statistics.all.wins /
|
(accountInfo.statistics.all.wins /
|
||||||
@@ -44,17 +45,17 @@ export const playerInfoCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
[
|
[
|
||||||
t`bot.commands.player_info.body.account_id`,
|
strings.bot.commands.player_info.body.account_id,
|
||||||
`${accountInfo.account_id}`,
|
`${accountInfo.account_id}`,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
t`bot.commands.player_info.body.created`,
|
strings.bot.commands.player_info.body.created,
|
||||||
new Date(accountInfo.created_at * 1000).toLocaleDateString(
|
new Date(accountInfo.created_at * 1000).toLocaleDateString(
|
||||||
interaction.locale,
|
interaction.locale,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
t`bot.commands.player_info.body.last_battle`,
|
strings.bot.commands.player_info.body.last_battle,
|
||||||
new Date(accountInfo.last_battle_time * 1000).toLocaleDateString(
|
new Date(accountInfo.last_battle_time * 1000).toLocaleDateString(
|
||||||
interaction.locale,
|
interaction.locale,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ import {
|
|||||||
getLeagueFromScore,
|
getLeagueFromScore,
|
||||||
getRatingInfo,
|
getRatingInfo,
|
||||||
getRatingNeighbors,
|
getRatingNeighbors,
|
||||||
|
imgur,
|
||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { SlashCommandSubcommandBuilder } from 'discord.js';
|
import { SlashCommandSubcommandBuilder } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import { Glow } from '../components/AllStatsOverview/components/HeroStat/components/Glow';
|
import { Glow } from '../components/AllStatsOverview/components/HeroStat/components/Glow';
|
||||||
@@ -52,7 +54,7 @@ export const ratingCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
const subcommand = interaction.options.getSubcommand(true) as
|
const subcommand = interaction.options.getSubcommand(true) as
|
||||||
| 'season'
|
| 'season'
|
||||||
| 'today';
|
| 'today';
|
||||||
const { t, translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const { id, region } = await resolvePlayerFromCommand(interaction);
|
const { id, region } = await resolvePlayerFromCommand(interaction);
|
||||||
const clan = (await getClanAccountInfo(region, id, ['clan']))?.clan;
|
const clan = (await getClanAccountInfo(region, id, ['clan']))?.clan;
|
||||||
const clanImage = clan ? emblemURL(clan.emblem_set_id) : undefined;
|
const clanImage = clan ? emblemURL(clan.emblem_set_id) : undefined;
|
||||||
@@ -88,7 +90,7 @@ export const ratingCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
const statsB2Array = (await getRatingNeighbors(region, id, 0)).neighbors;
|
const statsB2Array = (await getRatingNeighbors(region, id, 0)).neighbors;
|
||||||
|
|
||||||
if (statsB2Array === undefined) {
|
if (statsB2Array === undefined) {
|
||||||
return translate('bot.commands.rating.errors.no_participation', [
|
return literals(strings.bot.commands.rating.errors.no_participation, [
|
||||||
markdownEscape(accountInfo.nickname),
|
markdownEscape(accountInfo.nickname),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -97,10 +99,10 @@ export const ratingCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
const league = getLeagueFromScore(statsB2.score);
|
const league = getLeagueFromScore(statsB2.score);
|
||||||
|
|
||||||
if (!statsA) {
|
if (!statsA) {
|
||||||
return t`bot.commands.rating.errors.unrecorded_stats`;
|
return strings.bot.commands.rating.errors.unrecorded_stats;
|
||||||
}
|
}
|
||||||
if (!statsB1) {
|
if (!statsB1) {
|
||||||
return translate('bot.commands.rating.errors.no_participation', [
|
return literals(strings.bot.commands.rating.errors.no_participation, [
|
||||||
markdownEscape(accountInfo.nickname),
|
markdownEscape(accountInfo.nickname),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -119,15 +121,28 @@ export const ratingCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
statsB2,
|
statsB2,
|
||||||
);
|
);
|
||||||
const leagueTheme = LEAGUE_ACCENT[league.index];
|
const leagueTheme = LEAGUE_ACCENT[league.index];
|
||||||
|
let rewardImage = reward
|
||||||
|
? reward.type === 'vehicle'
|
||||||
|
? reward.vehicle.preview_image_url
|
||||||
|
: reward.stuff.image_url
|
||||||
|
: undefined;
|
||||||
|
|
||||||
|
if (rewardImage) {
|
||||||
|
const { ok } = await fetch(rewardImage);
|
||||||
|
|
||||||
|
if (!ok) {
|
||||||
|
rewardImage = imgur('kP88vqr');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CommandWrapper>
|
<CommandWrapper>
|
||||||
<TitleBar
|
<TitleBar
|
||||||
title={accountInfo.nickname}
|
title={accountInfo.nickname}
|
||||||
image={clanImage}
|
image={clanImage}
|
||||||
description={`${translate(
|
description={`${
|
||||||
`bot.commands.rating.body.subtitle.${subcommand}`,
|
strings.bot.commands.rating.body.subtitle[subcommand]
|
||||||
)} • ${new Date().toLocaleDateString(interaction.locale)}`}
|
} • ${new Date().toLocaleDateString(interaction.locale)}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@@ -325,11 +340,7 @@ export const ratingCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
height: 64,
|
height: 64,
|
||||||
objectFit: 'cover',
|
objectFit: 'cover',
|
||||||
}}
|
}}
|
||||||
src={await iconPng(
|
src={await iconPng(rewardImage!)}
|
||||||
reward.type === 'vehicle'
|
|
||||||
? reward.vehicle.preview_image_url
|
|
||||||
: reward.stuff.image_url,
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
RatingLeaderboard,
|
RatingLeaderboard,
|
||||||
Region,
|
Region,
|
||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import {
|
import {
|
||||||
APIApplicationCommandOptionChoice,
|
APIApplicationCommandOptionChoice,
|
||||||
Locale,
|
Locale,
|
||||||
@@ -54,26 +55,32 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
|||||||
);
|
);
|
||||||
|
|
||||||
function addOptions(option: SlashCommandSubcommandBuilder) {
|
function addOptions(option: SlashCommandSubcommandBuilder) {
|
||||||
const { t, translate } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
return option
|
return option
|
||||||
.addIntegerOption((option) =>
|
.addIntegerOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(t`bot.commands.rating_leaderboard.options.limit`)
|
.setName(strings.bot.commands.rating_leaderboard.options.limit.name)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.commands.rating_leaderboard.options.limit',
|
(strings) =>
|
||||||
|
strings.bot.commands.rating_leaderboard.options.limit.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
translate(
|
literals(
|
||||||
'bot.commands.rating_leaderboard.options.limit.description',
|
strings.bot.commands.rating_leaderboard.options.limit
|
||||||
|
.description,
|
||||||
[`${DEFAULT_LIMIT}`],
|
[`${DEFAULT_LIMIT}`],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.commands.rating_leaderboard.options.limit.description',
|
(strings) =>
|
||||||
|
strings.bot.commands.rating_leaderboard.options.limit
|
||||||
|
.description,
|
||||||
[`${DEFAULT_LIMIT}`],
|
[`${DEFAULT_LIMIT}`],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -83,20 +90,26 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
|||||||
)
|
)
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(t`bot.commands.rating_leaderboard.options.season`)
|
.setName(
|
||||||
|
strings.bot.commands.rating_leaderboard.options.season.name,
|
||||||
|
)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.commands.rating_leaderboard.options.season',
|
(strings) =>
|
||||||
|
strings.bot.commands.rating_leaderboard.options.season.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
translate(
|
strings.bot.commands.rating_leaderboard.options.season
|
||||||
'bot.commands.rating_leaderboard.options.season.description',
|
.description,
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.commands.rating_leaderboard.options.season.description',
|
(strings) =>
|
||||||
|
strings.bot.commands.rating_leaderboard.options.season
|
||||||
|
.description,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.setRequired(false)
|
.setRequired(false)
|
||||||
@@ -108,15 +121,18 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
name: current
|
name: current
|
||||||
? translate(
|
? literals(
|
||||||
'bot.commands.rating_leaderboard.options.season.choices.current',
|
strings.bot.commands.rating_leaderboard.options.season
|
||||||
|
.choices.current,
|
||||||
[`${number}`],
|
[`${number}`],
|
||||||
)
|
)
|
||||||
: `${number}`,
|
: `${number}`,
|
||||||
value: `${number}`,
|
value: `${number}`,
|
||||||
name_localizations: current
|
name_localizations: current
|
||||||
? localizationObject(
|
? localizationObject(
|
||||||
'bot.commands.rating_leaderboard.options.season.choices.current',
|
(strings) =>
|
||||||
|
strings.bot.commands.rating_leaderboard.options
|
||||||
|
.season.choices.current,
|
||||||
[`${number}`],
|
[`${number}`],
|
||||||
)
|
)
|
||||||
: undefined,
|
: undefined,
|
||||||
@@ -141,33 +157,45 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
|||||||
modify(option: SlashCommandSubcommandBuilder) {
|
modify(option: SlashCommandSubcommandBuilder) {
|
||||||
option
|
option
|
||||||
.addStringOption((option) => {
|
.addStringOption((option) => {
|
||||||
const { t, translate } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
return option
|
return option
|
||||||
.setName(t`bot.commands.rating_leaderboard.options.league`)
|
.setName(
|
||||||
|
strings.bot.commands.rating_leaderboard.options.league.name,
|
||||||
|
)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.commands.rating_leaderboard.options.league',
|
(strings) =>
|
||||||
|
strings.bot.commands.rating_leaderboard.options.league
|
||||||
|
.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
translate(
|
strings.bot.commands.rating_leaderboard.options.league
|
||||||
'bot.commands.rating_leaderboard.options.league.description',
|
.description,
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.commands.rating_leaderboard.options.league.description',
|
(strings) =>
|
||||||
|
strings.bot.commands.rating_leaderboard.options.league
|
||||||
|
.description,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.addChoices(
|
.addChoices(
|
||||||
...LEAGUES.map(
|
...LEAGUES.map(
|
||||||
({ name }, value) =>
|
({ name }, value) =>
|
||||||
({
|
({
|
||||||
name: translate(`common.leagues.${name}`),
|
name: (
|
||||||
|
strings.common.leagues as Record<string, string>
|
||||||
|
)[name],
|
||||||
value: `${value}`,
|
value: `${value}`,
|
||||||
name_localizations: localizationObject(
|
name_localizations: localizationObject(
|
||||||
`common.leagues.${name}`,
|
(strings) =>
|
||||||
|
(
|
||||||
|
strings.common.leagues as Record<string, string>
|
||||||
|
)[name],
|
||||||
),
|
),
|
||||||
}) satisfies APIApplicationCommandOptionChoice<string>,
|
}) satisfies APIApplicationCommandOptionChoice<string>,
|
||||||
),
|
),
|
||||||
@@ -183,7 +211,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
|||||||
// BIG TODO: title seems to be in english
|
// BIG TODO: title seems to be in english
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const { t, translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const subcommand = interaction.options.getSubcommand(true) as
|
const subcommand = interaction.options.getSubcommand(true) as
|
||||||
| 'league'
|
| 'league'
|
||||||
| 'neighbors';
|
| 'neighbors';
|
||||||
@@ -217,7 +245,8 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
|||||||
regionRatingInfo !== null &&
|
regionRatingInfo !== null &&
|
||||||
regionRatingInfo.detail !== undefined
|
regionRatingInfo.detail !== undefined
|
||||||
) {
|
) {
|
||||||
return t`bot.commands.rating_leaderboard.body.no_ongoing_season`;
|
return strings.bot.commands.rating_leaderboard.body
|
||||||
|
.no_ongoing_season;
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = isCurrentSeason
|
const result = isCurrentSeason
|
||||||
@@ -262,8 +291,9 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
|||||||
clan: clanData[player.id]?.clan?.tag,
|
clan: clanData[player.id]?.clan?.tag,
|
||||||
nickname:
|
nickname:
|
||||||
clanData[index]?.account_name ??
|
clanData[index]?.account_name ??
|
||||||
translate(
|
literals(
|
||||||
'bot.commands.rating_leaderboard.body.deleted_player',
|
strings.bot.commands.rating_leaderboard.body
|
||||||
|
.deleted_player,
|
||||||
[`${player.id}`],
|
[`${player.id}`],
|
||||||
),
|
),
|
||||||
}) satisfies SimplifiedPlayer,
|
}) satisfies SimplifiedPlayer,
|
||||||
@@ -283,12 +313,14 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
|||||||
: regionRatingInfo.count) - result[result.length - 1].position;
|
: regionRatingInfo.count) - result[result.length - 1].position;
|
||||||
titleName = `${
|
titleName = `${
|
||||||
leagueInfo
|
leagueInfo
|
||||||
? translate(`common.leagues.${LEAGUES[leagueInfo.index].name}`)
|
? (strings.common.leagues as Record<string, string>)[
|
||||||
|
LEAGUES[leagueInfo.index].name
|
||||||
|
]
|
||||||
: ''
|
: ''
|
||||||
} - ${translate(`common.regions.short.${region}`)}`;
|
} - ${strings.common.regions.short[region]}`;
|
||||||
titleImage = imgur(leagueInfo.icon);
|
titleImage = imgur(leagueInfo.icon);
|
||||||
titleDescription = translate(
|
titleDescription = literals(
|
||||||
'bot.commands.rating_leaderboard.body.top_players',
|
strings.bot.commands.rating_leaderboard.body.top_players,
|
||||||
[`${limit}`],
|
[`${limit}`],
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -301,7 +333,8 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
|||||||
regionRatingInfo !== null &&
|
regionRatingInfo !== null &&
|
||||||
regionRatingInfo.detail !== undefined
|
regionRatingInfo.detail !== undefined
|
||||||
) {
|
) {
|
||||||
return t`bot.commands.rating_leaderboard.body.no_ongoing_season`;
|
return strings.bot.commands.rating_leaderboard.body
|
||||||
|
.no_ongoing_season;
|
||||||
}
|
}
|
||||||
|
|
||||||
const accountInfo = await getAccountInfo(region, id);
|
const accountInfo = await getAccountInfo(region, id);
|
||||||
@@ -328,8 +361,9 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
|||||||
|
|
||||||
if (playerIndex === -1) {
|
if (playerIndex === -1) {
|
||||||
throw new UserError(
|
throw new UserError(
|
||||||
translate(
|
literals(
|
||||||
'bot.commands.rating_leaderboard.body.no_participation',
|
strings.bot.commands.rating_leaderboard.body
|
||||||
|
.no_participation,
|
||||||
[markdownEscape(accountInfo.nickname), `${season}`],
|
[markdownEscape(accountInfo.nickname), `${season}`],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -367,7 +401,8 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
|||||||
? `https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${clan.emblem_set_id}.png`
|
? `https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${clan.emblem_set_id}.png`
|
||||||
: undefined;
|
: undefined;
|
||||||
titleName = neighbors ? accountInfo.nickname : '';
|
titleName = neighbors ? accountInfo.nickname : '';
|
||||||
titleDescription = t`bot.commands.rating_leaderboard.body.neighbors`;
|
titleDescription =
|
||||||
|
strings.bot.commands.rating_leaderboard.body.neighbors;
|
||||||
playersAfter =
|
playersAfter =
|
||||||
(regionRatingInfo === null
|
(regionRatingInfo === null
|
||||||
? archivedLeaderboard.version!.value.entries.length
|
? archivedLeaderboard.version!.value.entries.length
|
||||||
@@ -416,8 +451,8 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
|||||||
{items}
|
{items}
|
||||||
{playersAfter > 0 && (
|
{playersAfter > 0 && (
|
||||||
<Leaderboard.Gap
|
<Leaderboard.Gap
|
||||||
message={translate(
|
message={literals(
|
||||||
'bot.commands.rating_leaderboard.body.more',
|
strings.bot.commands.rating_leaderboard.body.more,
|
||||||
[`${playersAfter.toLocaleString(interaction.locale)}`],
|
[`${playersAfter.toLocaleString(interaction.locale)}`],
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
tankIcon,
|
tankIcon,
|
||||||
TIER_ROMAN_NUMERALS,
|
TIER_ROMAN_NUMERALS,
|
||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
|
import { Locale } from 'discord.js';
|
||||||
import { clamp } from 'lodash-es';
|
import { clamp } from 'lodash-es';
|
||||||
import { CommandWrapper } from '../components/CommandWrapper';
|
import { CommandWrapper } from '../components/CommandWrapper';
|
||||||
import { TitleBar } from '../components/TitleBar';
|
import { TitleBar } from '../components/TitleBar';
|
||||||
@@ -18,6 +19,7 @@ import { RenderConfiguration } from '../core/blitzkit/renderConfiguration';
|
|||||||
import { blitzStarsTankAverages } from '../core/blitzstars/tankAverages';
|
import { blitzStarsTankAverages } from '../core/blitzstars/tankAverages';
|
||||||
import { buttonLink } from '../core/discord/buttonLink';
|
import { buttonLink } from '../core/discord/buttonLink';
|
||||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
||||||
|
import { translator } from '../core/localization/translator';
|
||||||
import { CommandRegistry } from '../events/interactionCreate';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import { theme } from '../stitches.config';
|
import { theme } from '../stitches.config';
|
||||||
|
|
||||||
@@ -218,11 +220,13 @@ function stat(value: string | number, flex = 2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function playerListing(
|
async function playerListing(
|
||||||
|
locale: Locale,
|
||||||
player: WotInspectorReplayPlayerData,
|
player: WotInspectorReplayPlayerData,
|
||||||
protagonistTeam: boolean,
|
protagonistTeam: boolean,
|
||||||
winningTeam: number,
|
winningTeam: number,
|
||||||
recordingPlayer = false,
|
recordingPlayer = false,
|
||||||
) {
|
) {
|
||||||
|
const { unwrap } = translator(locale);
|
||||||
const awaitedTankAverages = await blitzStarsTankAverages;
|
const awaitedTankAverages = await blitzStarsTankAverages;
|
||||||
const awaitedTankDefinitions = await tankDefinitions;
|
const awaitedTankDefinitions = await tankDefinitions;
|
||||||
const tank = awaitedTankDefinitions.tanks[player.vehicle_descr];
|
const tank = awaitedTankDefinitions.tanks[player.vehicle_descr];
|
||||||
@@ -275,7 +279,7 @@ async function playerListing(
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt={tank.name}
|
alt={unwrap(tank.name)}
|
||||||
src={await iconPng(tankIcon(tank.id))}
|
src={await iconPng(tankIcon(tank.id))}
|
||||||
style={{
|
style={{
|
||||||
width: 32,
|
width: 32,
|
||||||
@@ -312,7 +316,7 @@ async function playerListing(
|
|||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{tank.name}
|
{unwrap(tank.name)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -530,6 +534,7 @@ export const replayCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
)
|
)
|
||||||
.map((player) =>
|
.map((player) =>
|
||||||
playerListing(
|
playerListing(
|
||||||
|
interaction.locale,
|
||||||
player,
|
player,
|
||||||
true,
|
true,
|
||||||
replayData.winner_team,
|
replayData.winner_team,
|
||||||
@@ -553,7 +558,12 @@ export const replayCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
players
|
players
|
||||||
.filter((player) => player.team === antagonistTeamId)
|
.filter((player) => player.team === antagonistTeamId)
|
||||||
.map((player) =>
|
.map((player) =>
|
||||||
playerListing(player, false, replayData.winner_team),
|
playerListing(
|
||||||
|
interaction.locale,
|
||||||
|
player,
|
||||||
|
false,
|
||||||
|
replayData.winner_team,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
TankType,
|
TankType,
|
||||||
TIER_ROMAN_NUMERALS,
|
TIER_ROMAN_NUMERALS,
|
||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { escapeMarkdown, Locale } from 'discord.js';
|
import { escapeMarkdown, Locale } from 'discord.js';
|
||||||
import { CommandWrapper } from '../components/CommandWrapper';
|
import { CommandWrapper } from '../components/CommandWrapper';
|
||||||
import { TitleBar } from '../components/TitleBar';
|
import { TitleBar } from '../components/TitleBar';
|
||||||
@@ -28,22 +29,28 @@ import { CommandRegistry } from '../events/interactionCreate';
|
|||||||
import { theme } from '../stitches.config';
|
import { theme } from '../stitches.config';
|
||||||
|
|
||||||
export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
||||||
const { t } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
command: createLocalizedCommand('research')
|
command: createLocalizedCommand('research')
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(t`bot.commands.research.options.target_tank`)
|
.setName(strings.bot.commands.research.options.target_tank.name)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject('bot.commands.research.options.target_tank'),
|
localizationObject(
|
||||||
|
(strings) =>
|
||||||
|
strings.bot.commands.research.options.target_tank.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
t`bot.commands.research.options.target_tank.description`,
|
strings.bot.commands.research.options.target_tank.description,
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.commands.research.options.target_tank.description',
|
(strings) =>
|
||||||
|
strings.bot.commands.research.options.target_tank.description,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.setAutocomplete(true)
|
.setAutocomplete(true)
|
||||||
@@ -51,16 +58,22 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
)
|
)
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(t`bot.commands.research.options.starting_tank`)
|
.setName(strings.bot.commands.research.options.starting_tank.name)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject('bot.commands.research.options.starting_tank'),
|
localizationObject(
|
||||||
|
(strings) =>
|
||||||
|
strings.bot.commands.research.options.starting_tank.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
t`bot.commands.research.options.starting_tank.description`,
|
strings.bot.commands.research.options.starting_tank.description,
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.commands.research.options.starting_tank.description',
|
(strings) =>
|
||||||
|
strings.bot.commands.research.options.starting_tank.description,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.setAutocomplete(true)
|
.setAutocomplete(true)
|
||||||
@@ -69,7 +82,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
.addStringOption(addUsernameChoices),
|
.addStringOption(addUsernameChoices),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const { t, translate } = translator(interaction.locale);
|
const { strings, unwrap } = translator(interaction.locale);
|
||||||
const awaitedTankDefinitions = await tankDefinitions;
|
const awaitedTankDefinitions = await tankDefinitions;
|
||||||
const targetTankId = await resolveTankId(
|
const targetTankId = await resolveTankId(
|
||||||
interaction.options.getString('target-tank', true),
|
interaction.options.getString('target-tank', true),
|
||||||
@@ -90,50 +103,55 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (targetTankId === startingTankId) {
|
if (targetTankId === startingTankId) {
|
||||||
return translate('bot.commands.research.errors.start_end_equal', [
|
return literals(
|
||||||
escapeMarkdown(targetTank.name),
|
strings.bot.commands.research.errors.start_end_equal,
|
||||||
]);
|
[escapeMarkdown(unwrap(targetTank.name))],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const startingTank = awaitedTankDefinitions.tanks[startingTankId];
|
const startingTank = awaitedTankDefinitions.tanks[startingTankId];
|
||||||
|
|
||||||
if (startingTank.tier > targetTank.tier) {
|
if (startingTank.tier > targetTank.tier) {
|
||||||
return translate('bot.commands.research.errors.unordered', [
|
return literals(strings.bot.commands.research.errors.unordered, [
|
||||||
escapeMarkdown(startingTank.name),
|
escapeMarkdown(unwrap(startingTank.name)),
|
||||||
escapeMarkdown(targetTank.name),
|
escapeMarkdown(unwrap(targetTank.name)),
|
||||||
escapeMarkdown(targetTank.name),
|
escapeMarkdown(unwrap(targetTank.name)),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!targetTankAncestry.includes(startingTankId)) {
|
if (!targetTankAncestry.includes(startingTankId)) {
|
||||||
return translate('bot.commands.research.errors.tanks_not_on_line', [
|
return literals(
|
||||||
escapeMarkdown(targetTank.name),
|
strings.bot.commands.research.errors.tanks_not_on_line,
|
||||||
escapeMarkdown(startingTank.name),
|
[
|
||||||
]);
|
escapeMarkdown(unwrap(targetTank.name)),
|
||||||
|
escapeMarkdown(unwrap(startingTank.name)),
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (targetTank.type !== TankType.RESEARCHABLE) {
|
if (targetTank.type !== TankType.RESEARCHABLE) {
|
||||||
return translate('bot.commands.research.errors.non_tech_tree', [
|
return literals(strings.bot.commands.research.errors.non_tech_tree, [
|
||||||
escapeMarkdown(targetTank.name),
|
escapeMarkdown(unwrap(targetTank.name)),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetTank.tier === 1) {
|
if (targetTank.tier === 1) {
|
||||||
return translate('bot.commands.research.errors.tier_1', [
|
return literals(strings.bot.commands.research.errors.tier_1, [
|
||||||
escapeMarkdown(targetTank.name),
|
escapeMarkdown(unwrap(targetTank.name)),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const tankStats = await getTankStats(region, id);
|
const tankStats = await getTankStats(region, id);
|
||||||
|
|
||||||
if (tankStats === null) {
|
if (tankStats === null) {
|
||||||
return t`bot.common.errors.no_tank_stats`;
|
return strings.bot.common.errors.no_tank_stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tankStats.some(({ tank_id }) => tank_id === targetTankId)) {
|
if (tankStats.some(({ tank_id }) => tank_id === targetTankId)) {
|
||||||
return translate('bot.commands.research.errors.already_researched', [
|
return literals(
|
||||||
escapeMarkdown(targetTank.name),
|
strings.bot.commands.research.errors.already_researched,
|
||||||
]);
|
[escapeMarkdown(unwrap(targetTank.name))],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const foundAncestor = targetTankAncestry.find(
|
const foundAncestor = targetTankAncestry.find(
|
||||||
@@ -247,7 +265,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
<TitleBar
|
<TitleBar
|
||||||
title={nickname}
|
title={nickname}
|
||||||
image={clanImage}
|
image={clanImage}
|
||||||
description={`${t`bot.commands.research.body.subtitle`} • ${
|
description={`${strings.bot.commands.research.body.subtitle} • ${
|
||||||
targetTank.name
|
targetTank.name
|
||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
@@ -284,7 +302,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
color: theme.colors.textHighContrast,
|
color: theme.colors.textHighContrast,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t`bot.commands.research.body.total`}
|
{strings.bot.commands.research.body.total}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -444,7 +462,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt={tank.name}
|
alt={unwrap(tank.name)}
|
||||||
src={TANK_ICONS[tank.class]}
|
src={TANK_ICONS[tank.class]}
|
||||||
width={16}
|
width={16}
|
||||||
height={16}
|
height={16}
|
||||||
@@ -455,7 +473,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
color: theme.colors.textHighContrast,
|
color: theme.colors.textHighContrast,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{tank.name}
|
{unwrap(tank.name)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -489,11 +507,14 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
color: theme.colors.textHighContrast,
|
color: theme.colors.textHighContrast,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{translate('bot.commands.research.body.research', [
|
{literals(
|
||||||
`${costs[index].research?.toLocaleString(
|
strings.bot.commands.research.body.research,
|
||||||
interaction.locale,
|
[
|
||||||
)}`,
|
`${costs[index].research?.toLocaleString(
|
||||||
])}
|
interaction.locale,
|
||||||
|
)}`,
|
||||||
|
],
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -519,9 +540,10 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
color: theme.colors.textHighContrast,
|
color: theme.colors.textHighContrast,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{translate('bot.commands.research.body.upgrades', [
|
{literals(
|
||||||
costs[index].upgrades.toLocaleString(),
|
strings.bot.commands.research.body.upgrades,
|
||||||
])}
|
[costs[index].upgrades.toLocaleString()],
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -547,11 +569,14 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
color: theme.colors.textHighContrast,
|
color: theme.colors.textHighContrast,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{translate('bot.commands.research.body.purchase', [
|
{literals(
|
||||||
costs[index].purchase.toLocaleString(
|
strings.bot.commands.research.body.purchase,
|
||||||
interaction.locale,
|
[
|
||||||
),
|
costs[index].purchase.toLocaleString(
|
||||||
])}
|
interaction.locale,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -576,11 +601,14 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
color: theme.colors.textHighContrast,
|
color: theme.colors.textHighContrast,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{translate('bot.commands.research.body.equipment', [
|
{literals(
|
||||||
costs[index].equipment.toLocaleString(
|
strings.bot.commands.research.body.equipment,
|
||||||
interaction.locale,
|
[
|
||||||
),
|
costs[index].equipment.toLocaleString(
|
||||||
])}
|
interaction.locale,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -594,7 +622,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
|
|
||||||
return startingTankRaw
|
return startingTankRaw
|
||||||
? image
|
? image
|
||||||
: [t`bot.commands.research.body.estimation`, image];
|
: [strings.bot.commands.research.body.estimation, image];
|
||||||
},
|
},
|
||||||
|
|
||||||
autocomplete(interaction) {
|
autocomplete(interaction) {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { ClanList, fetchBlitz, Region } from '@blitzkit/core';
|
import { ClanList, fetchBlitz, Region } from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { Locale } from 'discord.js';
|
import { Locale } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import { addClanChoices } from '../core/discord/addClanChoices';
|
import { addClanChoices } from '../core/discord/addClanChoices';
|
||||||
@@ -19,21 +20,27 @@ export const searchClansCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
addClanChoices(option).setAutocomplete(false),
|
addClanChoices(option).setAutocomplete(false),
|
||||||
)
|
)
|
||||||
.addIntegerOption((option) => {
|
.addIntegerOption((option) => {
|
||||||
const { t, translate } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
return option
|
return option
|
||||||
.setName(t`bot.commands.search_clans.options.limit`)
|
.setName(strings.bot.commands.search_clans.options.limit.name)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject('bot.commands.search_clans.options.limit'),
|
localizationObject(
|
||||||
|
(strings) => strings.bot.commands.search_clans.options.limit.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
translate('bot.commands.search_clans.options.limit.description', [
|
literals(
|
||||||
`${DEFAULT_LIMIT}`,
|
strings.bot.commands.search_clans.options.limit.description,
|
||||||
]),
|
[`${DEFAULT_LIMIT}`],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.commands.search_clans.options.limit.description',
|
(strings) =>
|
||||||
|
strings.bot.commands.search_clans.options.limit.description,
|
||||||
[`${DEFAULT_LIMIT}`],
|
[`${DEFAULT_LIMIT}`],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -42,7 +49,7 @@ export const searchClansCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const { translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const region = interaction.options.getString('region') as Region;
|
const region = interaction.options.getString('region') as Region;
|
||||||
const clan = interaction.options.getString('clan')!;
|
const clan = interaction.options.getString('clan')!;
|
||||||
const limit = interaction.options.getInteger('limit') ?? DEFAULT_LIMIT;
|
const limit = interaction.options.getInteger('limit') ?? DEFAULT_LIMIT;
|
||||||
@@ -52,12 +59,12 @@ export const searchClansCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return embedInfo(
|
return embedInfo(
|
||||||
translate('bot.commands.search_clans.body.title', [
|
literals(strings.bot.commands.search_clans.body.title, [
|
||||||
markdownEscape(clan),
|
markdownEscape(clan),
|
||||||
translate(`common.regions.normal.${region}`),
|
strings.common.regions.normal[region],
|
||||||
]),
|
]),
|
||||||
clanList.length === 0
|
clanList.length === 0
|
||||||
? translate('bot.commands.search_clans.body.no_results')
|
? strings.bot.commands.search_clans.body.no_results
|
||||||
: `\`\`\`\n${clanList
|
: `\`\`\`\n${clanList
|
||||||
.map((clan) => `${clan.name} [${clan.tag}]`)
|
.map((clan) => `${clan.name} [${clan.tag}]`)
|
||||||
.join('\n')}\n\`\`\``,
|
.join('\n')}\n\`\`\``,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
Region,
|
Region,
|
||||||
usernamePattern,
|
usernamePattern,
|
||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { Locale } from 'discord.js';
|
import { Locale } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import { addRegionChoices } from '../core/discord/addRegionChoices';
|
import { addRegionChoices } from '../core/discord/addRegionChoices';
|
||||||
@@ -17,7 +18,7 @@ import { CommandRegistry } from '../events/interactionCreate';
|
|||||||
const DEFAULT_LIMIT = 25;
|
const DEFAULT_LIMIT = 25;
|
||||||
|
|
||||||
export const searchPlayersCommand = new Promise<CommandRegistry>((resolve) => {
|
export const searchPlayersCommand = new Promise<CommandRegistry>((resolve) => {
|
||||||
const { t, translate } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
command: createLocalizedCommand('search-players')
|
command: createLocalizedCommand('search-players')
|
||||||
@@ -27,18 +28,25 @@ export const searchPlayersCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
)
|
)
|
||||||
.addIntegerOption((option) =>
|
.addIntegerOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(t`bot.commands.search_players.options.limit`)
|
.setName(strings.bot.commands.search_players.options.limit.name)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject('bot.commands.search_players.options.limit'),
|
localizationObject(
|
||||||
|
(strings) =>
|
||||||
|
strings.bot.commands.search_players.options.limit.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
translate('bot.commands.search_players.options.limit.description', [
|
literals(
|
||||||
`${DEFAULT_LIMIT}`,
|
strings.bot.commands.search_players.options.limit.description,
|
||||||
]),
|
[`${DEFAULT_LIMIT}`],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.commands.search_players.options.limit.description',
|
(strings) =>
|
||||||
|
strings.bot.commands.search_players.options.limit.description,
|
||||||
[`${DEFAULT_LIMIT}`],
|
[`${DEFAULT_LIMIT}`],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -47,7 +55,7 @@ export const searchPlayersCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
),
|
),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const { translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const region = interaction.options.getString('region') as Region;
|
const region = interaction.options.getString('region') as Region;
|
||||||
const name = interaction.options.getString('username')!;
|
const name = interaction.options.getString('username')!;
|
||||||
const limit = interaction.options.getInteger('limit') ?? 25;
|
const limit = interaction.options.getInteger('limit') ?? 25;
|
||||||
@@ -60,13 +68,13 @@ export const searchPlayersCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
: [];
|
: [];
|
||||||
|
|
||||||
return embedInfo(
|
return embedInfo(
|
||||||
translate('bot.commands.search_players.body.title', [
|
literals(strings.bot.commands.search_players.body.title, [
|
||||||
markdownEscape(trimmedSearch),
|
markdownEscape(trimmedSearch),
|
||||||
translate(`common.regions.normal.${region}`),
|
strings.common.regions.normal[region],
|
||||||
]),
|
]),
|
||||||
`\`\`\`${
|
`\`\`\`${
|
||||||
players.length === 0
|
players.length === 0
|
||||||
? translate('bot.commands.search_players.body.no_results')
|
? strings.bot.commands.search_players.body.no_results
|
||||||
: players.map((player) => player.nickname).join('\n')
|
: players.map((player) => player.nickname).join('\n')
|
||||||
}\`\`\``,
|
}\`\`\``,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export function AllStatsOverview({
|
|||||||
locale,
|
locale,
|
||||||
supplementaryStats,
|
supplementaryStats,
|
||||||
}: AllStatsOverviewProps) {
|
}: AllStatsOverviewProps) {
|
||||||
const { t, translate } = translator(locale);
|
const { strings } = translator(locale);
|
||||||
const percentile =
|
const percentile =
|
||||||
typeof supplementaryStats.WN8 === 'number'
|
typeof supplementaryStats.WN8 === 'number'
|
||||||
? getWN8Percentile(supplementaryStats.WN8)
|
? getWN8Percentile(supplementaryStats.WN8)
|
||||||
@@ -63,18 +63,18 @@ export function AllStatsOverview({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<WN8SurroundingStat
|
<WN8SurroundingStat
|
||||||
label={t`bot.common.hero_stats.battles`}
|
label={strings.bot.common.hero_stats.battles}
|
||||||
value={stats.battles.toLocaleString()}
|
value={stats.battles.toLocaleString()}
|
||||||
align={WN8SurroundingStatAlign.Right}
|
align={WN8SurroundingStatAlign.Right}
|
||||||
/>
|
/>
|
||||||
<WN8SurroundingStat
|
<WN8SurroundingStat
|
||||||
label={t`bot.common.hero_stats.winrate`}
|
label={strings.bot.common.hero_stats.winrate}
|
||||||
value={`${(100 * (stats.wins / stats.battles)).toFixed(2)}%`}
|
value={`${(100 * (stats.wins / stats.battles)).toFixed(2)}%`}
|
||||||
align={WN8SurroundingStatAlign.Right}
|
align={WN8SurroundingStatAlign.Right}
|
||||||
padded
|
padded
|
||||||
/>
|
/>
|
||||||
<WN8SurroundingStat
|
<WN8SurroundingStat
|
||||||
label={t`bot.common.hero_stats.damage`}
|
label={strings.bot.common.hero_stats.damage}
|
||||||
value={Math.round(
|
value={Math.round(
|
||||||
stats.damage_dealt / stats.battles,
|
stats.damage_dealt / stats.battles,
|
||||||
).toLocaleString()}
|
).toLocaleString()}
|
||||||
@@ -82,7 +82,7 @@ export function AllStatsOverview({
|
|||||||
padded
|
padded
|
||||||
/>
|
/>
|
||||||
<WN8SurroundingStat
|
<WN8SurroundingStat
|
||||||
label={t`bot.common.hero_stats.damage_ratio`}
|
label={strings.bot.common.hero_stats.damage_ratio}
|
||||||
value={(stats.damage_dealt / stats.damage_received).toFixed(2)}
|
value={(stats.damage_dealt / stats.damage_received).toFixed(2)}
|
||||||
align={WN8SurroundingStatAlign.Right}
|
align={WN8SurroundingStatAlign.Right}
|
||||||
/>
|
/>
|
||||||
@@ -90,7 +90,7 @@ export function AllStatsOverview({
|
|||||||
|
|
||||||
<HeroStat
|
<HeroStat
|
||||||
value={heroStat}
|
value={heroStat}
|
||||||
subtitle={translate(`common.wn8_percentile.${percentile}`)}
|
subtitle={strings.common.wn8_percentile[percentile]}
|
||||||
color={color}
|
color={color}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -103,25 +103,25 @@ export function AllStatsOverview({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<WN8SurroundingStat
|
<WN8SurroundingStat
|
||||||
label={t`bot.common.hero_stats.tier`}
|
label={strings.bot.common.hero_stats.tier}
|
||||||
value={
|
value={
|
||||||
supplementaryStats.tier ? supplementaryStats.tier.toFixed(2) : '--'
|
supplementaryStats.tier ? supplementaryStats.tier.toFixed(2) : '--'
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<WN8SurroundingStat
|
<WN8SurroundingStat
|
||||||
label={t`bot.common.hero_stats.survival`}
|
label={strings.bot.common.hero_stats.survival}
|
||||||
value={`${(100 * (stats.survived_battles / stats.battles)).toFixed(
|
value={`${(100 * (stats.survived_battles / stats.battles)).toFixed(
|
||||||
2,
|
2,
|
||||||
)}%`}
|
)}%`}
|
||||||
padded
|
padded
|
||||||
/>
|
/>
|
||||||
<WN8SurroundingStat
|
<WN8SurroundingStat
|
||||||
label={t`bot.common.hero_stats.accuracy`}
|
label={strings.bot.common.hero_stats.accuracy}
|
||||||
value={`${(100 * (stats.hits / stats.shots)).toFixed(2)}%`}
|
value={`${(100 * (stats.hits / stats.shots)).toFixed(2)}%`}
|
||||||
padded
|
padded
|
||||||
/>
|
/>
|
||||||
<WN8SurroundingStat
|
<WN8SurroundingStat
|
||||||
label={t`bot.common.hero_stats.kills`}
|
label={strings.bot.common.hero_stats.kills}
|
||||||
value={(stats.frags / stats.battles).toFixed(2)}
|
value={(stats.frags / stats.battles).toFixed(2)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ export function CommandWrapper({ children, fat }: CommandWrapperProps) {
|
|||||||
gap: 16,
|
gap: 16,
|
||||||
width: '100%',
|
width: '100%',
|
||||||
color: theme.colors.textHighContrast,
|
color: theme.colors.textHighContrast,
|
||||||
|
backgroundColor: theme.colors.appBackground1,
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
background: theme.colors.appBackground1,
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export function GenericAllStats({
|
|||||||
supplementaryStats,
|
supplementaryStats,
|
||||||
locale,
|
locale,
|
||||||
}: GenericAllStatsProps) {
|
}: GenericAllStatsProps) {
|
||||||
const { t } = translator(locale);
|
const { strings } = translator(locale);
|
||||||
const damageRatio = stats.damage_dealt / stats.damage_received;
|
const damageRatio = stats.damage_dealt / stats.damage_received;
|
||||||
const killsToDeathRatio =
|
const killsToDeathRatio =
|
||||||
stats.frags / (stats.battles - stats.survived_battles);
|
stats.frags / (stats.battles - stats.survived_battles);
|
||||||
@@ -30,27 +30,28 @@ export function GenericAllStats({
|
|||||||
<Root>
|
<Root>
|
||||||
<Row>
|
<Row>
|
||||||
<Card
|
<Card
|
||||||
title={t`bot.commands.full_stats.body.cards.games`}
|
title={strings.bot.commands.full_stats.body.cards.games.title}
|
||||||
items={[
|
items={[
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.games.winrate`,
|
label: strings.bot.commands.full_stats.body.cards.games.winrate,
|
||||||
value: `${(100 * (stats.wins / stats.battles)).toFixed(2)}%`,
|
value: `${(100 * (stats.wins / stats.battles)).toFixed(2)}%`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.games.battles`,
|
label: strings.bot.commands.full_stats.body.cards.games.battles,
|
||||||
value: stats.battles,
|
value: stats.battles,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.games.wins_losses`,
|
label:
|
||||||
|
strings.bot.commands.full_stats.body.cards.games.wins_losses,
|
||||||
value: `${stats.wins} / ${stats.losses}`,
|
value: `${stats.wins} / ${stats.losses}`,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<Card
|
<Card
|
||||||
title={t`bot.commands.full_stats.body.cards.efficiency`}
|
title={strings.bot.commands.full_stats.body.cards.efficiency.title}
|
||||||
items={[
|
items={[
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.efficiency.wn8`,
|
label: strings.bot.commands.full_stats.body.cards.efficiency.wn8,
|
||||||
value:
|
value:
|
||||||
supplementaryStats && isNumber(supplementaryStats.WN8)
|
supplementaryStats && isNumber(supplementaryStats.WN8)
|
||||||
? supplementaryStats.WN8!.toFixed(0)
|
? supplementaryStats.WN8!.toFixed(0)
|
||||||
@@ -60,14 +61,16 @@ export function GenericAllStats({
|
|||||||
: undefined,
|
: undefined,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.efficiency.survival`,
|
label:
|
||||||
|
strings.bot.commands.full_stats.body.cards.efficiency.survival,
|
||||||
value: `${(
|
value: `${(
|
||||||
100 *
|
100 *
|
||||||
(stats.survived_battles / stats.battles)
|
(stats.survived_battles / stats.battles)
|
||||||
).toFixed(2)}%`,
|
).toFixed(2)}%`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.efficiency.accuracy`,
|
label:
|
||||||
|
strings.bot.commands.full_stats.body.cards.efficiency.accuracy,
|
||||||
value: `${((stats.hits / stats.shots) * 100).toFixed(2)}%`,
|
value: `${((stats.hits / stats.shots) * 100).toFixed(2)}%`,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
@@ -75,14 +78,18 @@ export function GenericAllStats({
|
|||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Card
|
<Card
|
||||||
title={t`bot.commands.full_stats.body.cards.lethality`}
|
title={strings.bot.commands.full_stats.body.cards.lethality.title}
|
||||||
items={[
|
items={[
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.lethality.average_damage`,
|
label:
|
||||||
|
strings.bot.commands.full_stats.body.cards.lethality
|
||||||
|
.average_damage,
|
||||||
value: (stats.damage_dealt / stats.battles).toFixed(0),
|
value: (stats.damage_dealt / stats.battles).toFixed(0),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.lethality.damage_per_tier`,
|
label:
|
||||||
|
strings.bot.commands.full_stats.body.cards.lethality
|
||||||
|
.damage_per_tier,
|
||||||
value: supplementaryStats?.tier
|
value: supplementaryStats?.tier
|
||||||
? (
|
? (
|
||||||
stats.damage_dealt /
|
stats.damage_dealt /
|
||||||
@@ -92,32 +99,44 @@ export function GenericAllStats({
|
|||||||
: undefined,
|
: undefined,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.lethality.damage_ratio`,
|
label:
|
||||||
|
strings.bot.commands.full_stats.body.cards.lethality
|
||||||
|
.damage_ratio,
|
||||||
value: isFinite(damageRatio) ? damageRatio.toFixed(2) : undefined,
|
value: isFinite(damageRatio) ? damageRatio.toFixed(2) : undefined,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.lethality.average_kills`,
|
label:
|
||||||
|
strings.bot.commands.full_stats.body.cards.lethality
|
||||||
|
.average_kills,
|
||||||
value: (stats.frags / stats.battles).toFixed(0),
|
value: (stats.frags / stats.battles).toFixed(0),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<Card
|
<Card
|
||||||
title={t`bot.commands.full_stats.body.cards.miscellaneous`}
|
title={strings.bot.commands.full_stats.body.cards.miscellaneous.title}
|
||||||
items={[
|
items={[
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.miscellaneous.average_tier`,
|
label:
|
||||||
|
strings.bot.commands.full_stats.body.cards.miscellaneous
|
||||||
|
.average_tier,
|
||||||
value: supplementaryStats?.tier?.toFixed(2),
|
value: supplementaryStats?.tier?.toFixed(2),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.miscellaneous.average_spots`,
|
label:
|
||||||
|
strings.bot.commands.full_stats.body.cards.miscellaneous
|
||||||
|
.average_spots,
|
||||||
value: (stats.spotted / stats.battles).toFixed(2),
|
value: (stats.spotted / stats.battles).toFixed(2),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.miscellaneous.average_xp`,
|
label:
|
||||||
|
strings.bot.commands.full_stats.body.cards.miscellaneous
|
||||||
|
.average_xp,
|
||||||
value: (stats.xp / stats.battles).toFixed(0),
|
value: (stats.xp / stats.battles).toFixed(0),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t`bot.commands.full_stats.body.cards.miscellaneous.kills_to_death_ratio`,
|
label:
|
||||||
|
strings.bot.commands.full_stats.body.cards.miscellaneous
|
||||||
|
.kills_to_death_ratio,
|
||||||
value: isFinite(killsToDeathRatio)
|
value: isFinite(killsToDeathRatio)
|
||||||
? killsToDeathRatio.toFixed(2)
|
? killsToDeathRatio.toFixed(2)
|
||||||
: undefined,
|
: undefined,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ interface NoDataProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function NoData({ type, locale }: NoDataProps) {
|
export function NoData({ type, locale }: NoDataProps) {
|
||||||
const { translate } = translator(locale);
|
const { strings } = translator(locale);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -23,7 +23,7 @@ export function NoData({ type, locale }: NoDataProps) {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span style={{ fontSize: 16, color: theme.colors.textLowContrast }}>
|
<span style={{ fontSize: 16, color: theme.colors.textLowContrast }}>
|
||||||
{translate(`bot.common.no_data.${type}`)}
|
{strings.bot.common.no_data[type]}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { SEARCH_KEYS } from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { Locale } from 'discord.js';
|
import { Locale } from 'discord.js';
|
||||||
import { go } from 'fuzzysort';
|
import { go } from 'fuzzysort';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
@@ -11,22 +13,19 @@ export async function resolveTankId(
|
|||||||
locale: Locale,
|
locale: Locale,
|
||||||
techTreeOnly = false,
|
techTreeOnly = false,
|
||||||
) {
|
) {
|
||||||
const { translate } = translator(locale);
|
const { strings } = translator(locale);
|
||||||
const number = typeof tank === 'string' ? Number(tank) : tank;
|
const number = typeof tank === 'string' ? Number(tank) : tank;
|
||||||
|
|
||||||
if (Number.isNaN(number)) {
|
if (Number.isNaN(number)) {
|
||||||
const searchResult = go(
|
const searchResult = go(
|
||||||
`${tank}`,
|
`${tank}`,
|
||||||
await (techTreeOnly ? tankNamesTechTreeOnly : tankNames),
|
await (techTreeOnly ? tankNamesTechTreeOnly : tankNames),
|
||||||
{
|
{ keys: SEARCH_KEYS, limit: 1 },
|
||||||
keys: ['searchableName', 'searchableNameDeburr', 'camouflages'],
|
|
||||||
limit: 1,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (searchResult.length === 0) {
|
if (searchResult.length === 0) {
|
||||||
throw new UserError(
|
throw new UserError(
|
||||||
translate('bot.common.errors.tank_name_not_found', [
|
literals(strings.bot.common.errors.tank_name_not_found, [
|
||||||
markdownEscape(`${tank}`),
|
markdownEscape(`${tank}`),
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
@@ -40,7 +39,7 @@ export async function resolveTankId(
|
|||||||
return number;
|
return number;
|
||||||
} else {
|
} else {
|
||||||
throw new UserError(
|
throw new UserError(
|
||||||
translate('bot.common.errors.tank_id_not_found', [`${number}`]),
|
literals(strings.bot.common.errors.tank_id_not_found, [`${number}`]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { searchClansAcrossRegions } from '@blitzkit/core';
|
||||||
|
import { Locale } from 'discord.js';
|
||||||
|
import { UserError } from '../blitzkit/userError';
|
||||||
|
import { translator } from '../localization/translator';
|
||||||
|
|
||||||
|
export async function searchClansAcrossRegionsBotWrapper(
|
||||||
|
search: string,
|
||||||
|
locale: Locale,
|
||||||
|
limit?: number,
|
||||||
|
) {
|
||||||
|
const { strings } = translator(locale);
|
||||||
|
const trimmed = search.trim();
|
||||||
|
|
||||||
|
if (trimmed.length < 3) {
|
||||||
|
throw new UserError(strings.bot.common.errors.query_too_small);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trimmed.length > 100) {
|
||||||
|
throw new UserError(strings.bot.common.errors.query_too_long);
|
||||||
|
}
|
||||||
|
|
||||||
|
return await searchClansAcrossRegions(trimmed, limit);
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { searchPlayersAcrossRegions } from '@blitzkit/core';
|
||||||
|
import { Locale } from 'discord.js';
|
||||||
|
import { UserError } from '../blitzkit/userError';
|
||||||
|
import { translator } from '../localization/translator';
|
||||||
|
|
||||||
|
export async function searchPlayersAcrossRegionsBotWrapper(
|
||||||
|
search: string,
|
||||||
|
locale: Locale,
|
||||||
|
limit?: number,
|
||||||
|
) {
|
||||||
|
const { strings } = translator(locale);
|
||||||
|
const trimmed = search.trim();
|
||||||
|
|
||||||
|
if (trimmed.length < 3) {
|
||||||
|
throw new UserError(strings.bot.common.errors.query_too_small);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trimmed.length > 100) {
|
||||||
|
throw new UserError(strings.bot.common.errors.query_too_long);
|
||||||
|
}
|
||||||
|
|
||||||
|
return await searchPlayersAcrossRegions(trimmed, limit);
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import { fetchTankDefinitions, TIER_ROMAN_NUMERALS } from '@blitzkit/core';
|
import { fetchTankDefinitions, TIER_ROMAN_NUMERALS } from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { Locale } from 'discord.js';
|
import { Locale } from 'discord.js';
|
||||||
import { StatFilters } from '../blitzstars/filterStats';
|
import { StatFilters } from '../blitzstars/filterStats';
|
||||||
import { translator } from '../localization/translator';
|
import { translator } from '../localization/translator';
|
||||||
@@ -7,22 +8,21 @@ export async function filtersToDescription(
|
|||||||
{ nation, tier, type, class: tankClass, tank }: StatFilters,
|
{ nation, tier, type, class: tankClass, tank }: StatFilters,
|
||||||
locale: Locale,
|
locale: Locale,
|
||||||
) {
|
) {
|
||||||
const { translate } = translator(locale);
|
const { strings, bkLocale } = translator(locale);
|
||||||
const awaitedTankDefinitions = await fetchTankDefinitions();
|
const awaitedTankDefinitions = await fetchTankDefinitions();
|
||||||
const info: string[] = [];
|
const info: string[] = [];
|
||||||
|
|
||||||
// TODO: somehow localize tank names?
|
// TODO: somehow localize tank names?
|
||||||
if (tank) return awaitedTankDefinitions.tanks[tank].name;
|
if (tank) return awaitedTankDefinitions.tanks[tank].name.locales[bkLocale];
|
||||||
if (nation) info.push(translate(`common.nations.${nation}`));
|
if (nation)
|
||||||
|
info.push((strings.common.nations as Record<string, string>)[nation]);
|
||||||
if (tier) {
|
if (tier) {
|
||||||
info.push(
|
info.push(
|
||||||
translate('bot.common.filters.tier', [TIER_ROMAN_NUMERALS[tier]]),
|
literals(strings.bot.common.filters.tier, [TIER_ROMAN_NUMERALS[tier]]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (tankClass) info.push(translate(`common.tank_class_short.${tankClass}`));
|
if (tankClass) info.push(strings.common.tank_class_short[tankClass]);
|
||||||
if (type) info.push(translate(`common.tree_type.${type}`));
|
if (type) info.push(strings.common.tree_type[type]);
|
||||||
|
|
||||||
return info.length === 0
|
return info.length === 0 ? strings.bot.common.filters.none : info.join(', ');
|
||||||
? translate('bot.common.filters.none')
|
|
||||||
: info.join(', ');
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { idToRegion, usersDatabase } from '@blitzkit/core';
|
import { idToRegion } from '@blitzkit/core';
|
||||||
import { flagUserActivity } from '@blitzkit/core/src/blitzkit/flagUserActivity';
|
import { flagUserActivity } from '../db/flagUserActivity';
|
||||||
|
import { usersDatabase } from '../db/users';
|
||||||
|
|
||||||
export async function getBlitzFromDiscord(discordId: bigint) {
|
export async function getBlitzFromDiscord(discordId: bigint) {
|
||||||
const unique = await usersDatabase.discordUser.findUnique({
|
const unique = await usersDatabase.discordUser.findUnique({
|
||||||
@@ -8,6 +9,8 @@ export async function getBlitzFromDiscord(discordId: bigint) {
|
|||||||
|
|
||||||
if (unique === null) return null;
|
if (unique === null) return null;
|
||||||
|
|
||||||
await flagUserActivity(unique.blitz_id);
|
const id = Number(unique.blitz_id);
|
||||||
return { id: unique.blitz_id, region: idToRegion(unique.blitz_id) };
|
|
||||||
|
await flagUserActivity(id);
|
||||||
|
return { id, region: idToRegion(id) };
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
fetchDiscoveredIdsDefinitions,
|
||||||
fetchGameDefinitions,
|
fetchGameDefinitions,
|
||||||
fetchMapDefinitions,
|
fetchMapDefinitions,
|
||||||
fetchTankDefinitions,
|
fetchTankDefinitions,
|
||||||
@@ -9,3 +10,4 @@ export const tankDefinitions = fetchTankDefinitions();
|
|||||||
export const gameDefinitions = fetchGameDefinitions();
|
export const gameDefinitions = fetchGameDefinitions();
|
||||||
export const tankNames = fetchTankNames();
|
export const tankNames = fetchTankNames();
|
||||||
export const mapDefinitions = fetchMapDefinitions();
|
export const mapDefinitions = fetchMapDefinitions();
|
||||||
|
export const discoveredIdsDefinitions = fetchDiscoveredIdsDefinitions();
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { usersDatabase } from '@blitzkit/core';
|
import { usersDatabase } from '../db/users';
|
||||||
import { client } from '../discord/client';
|
import { client } from '../discord/client';
|
||||||
|
|
||||||
const EXIT_EVENTS = [
|
const EXIT_EVENTS = [
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export async function getTankHistories(
|
|||||||
locale: Locale,
|
locale: Locale,
|
||||||
options?: Partial<GetTankHistoriesOptions>,
|
options?: Partial<GetTankHistoriesOptions>,
|
||||||
) {
|
) {
|
||||||
const { t } = translator(locale);
|
const { strings } = translator(locale);
|
||||||
const mergedOptions = { ...getTankHistoriesDefaultOptions, ...options };
|
const mergedOptions = { ...getTankHistoriesDefaultOptions, ...options };
|
||||||
const tankHistoriesResponse = await fetch(
|
const tankHistoriesResponse = await fetch(
|
||||||
`https://www.blitzstars.com/api/tankhistories/for/${id}/`,
|
`https://www.blitzstars.com/api/tankhistories/for/${id}/`,
|
||||||
@@ -82,7 +82,7 @@ export async function getTankHistories(
|
|||||||
const tankStats = await getTankStats(server, id);
|
const tankStats = await getTankStats(server, id);
|
||||||
|
|
||||||
if (tankStats === null) {
|
if (tankStats === null) {
|
||||||
throw new UserError(t`bot.common.errors.no_tank_stats`);
|
throw new UserError(strings.bot.common.errors.no_tank_stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
tankStats.forEach((tankHistory) => {
|
tankStats.forEach((tankHistory) => {
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { usersDatabase } from '@blitzkit/core';
|
import { usersDatabase } from './users';
|
||||||
|
|
||||||
export async function flagUserActivity(blitzId: number) {
|
export async function flagUserActivity(blitzId: number) {
|
||||||
await usersDatabase.user.upsert({
|
await usersDatabase.user.upsert({
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { usersDatabase } from '@blitzkit/core';
|
|
||||||
import { flagUserActivity } from './flagUserActivity';
|
import { flagUserActivity } from './flagUserActivity';
|
||||||
|
import { usersDatabase } from './users';
|
||||||
|
|
||||||
export async function linkBlitzAndDiscord(discordId: bigint, blitzId: number) {
|
export async function linkBlitzAndDiscord(discordId: bigint, blitzId: number) {
|
||||||
await usersDatabase.discordUser.upsert({
|
await usersDatabase.discordUser.upsert({
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '../../prisma';
|
||||||
|
|
||||||
export const usersDatabase = new PrismaClient();
|
export const usersDatabase = new PrismaClient();
|
||||||
@@ -3,14 +3,22 @@ import { translator } from '../localization/translator';
|
|||||||
import { localizationObject } from './localizationObject';
|
import { localizationObject } from './localizationObject';
|
||||||
|
|
||||||
export function addClanChoices(option: SlashCommandStringOption) {
|
export function addClanChoices(option: SlashCommandStringOption) {
|
||||||
const { translate } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
return option
|
return option
|
||||||
.setName('clan')
|
.setName('clan')
|
||||||
.setNameLocalizations(localizationObject('bot.common.options.clan'))
|
.setNameLocalizations(
|
||||||
.setDescription(translate('bot.common.options.clan.description'))
|
localizationObject(
|
||||||
|
(strings) => strings.bot.common.options.clan.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.setDescription(strings.bot.common.options.clan.description)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject('bot.common.options.clan.description'),
|
localizationObject(
|
||||||
|
(strings) => strings.bot.common.options.clan.description,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.setAutocomplete(true)
|
.setAutocomplete(true)
|
||||||
.setMinLength(2)
|
.setMinLength(2)
|
||||||
|
|||||||
@@ -17,30 +17,40 @@ import { localizationObject } from './localizationObject';
|
|||||||
export function addFilterOptions<
|
export function addFilterOptions<
|
||||||
Option extends SlashCommandBuilder | SlashCommandSubcommandBuilder,
|
Option extends SlashCommandBuilder | SlashCommandSubcommandBuilder,
|
||||||
>(option: Option, nations: string[]) {
|
>(option: Option, nations: string[]) {
|
||||||
const { translate } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
option
|
option
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(translate('bot.common.options.filters.nation'))
|
.setName(strings.bot.common.options.filters.nation.name)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject('bot.common.options.filters.nation'),
|
localizationObject(
|
||||||
)
|
(strings) => strings.bot.common.options.filters.nation.name,
|
||||||
.setDescription(
|
undefined,
|
||||||
translate('bot.common.options.filters.nation.description'),
|
true,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
.setDescription(strings.bot.common.options.filters.nation.description)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject('bot.common.options.filters.nation.description'),
|
localizationObject(
|
||||||
|
(strings) =>
|
||||||
|
strings.bot.common.options.filters.nation.description,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.addChoices(
|
.addChoices(
|
||||||
...nations.map(
|
...nations.map(
|
||||||
(nation) =>
|
(nation) =>
|
||||||
({
|
({
|
||||||
value: nation,
|
value: nation,
|
||||||
name: translate(`common.nations.${nation}`),
|
name: (strings.common.nations as Record<string, string>)[
|
||||||
|
nation
|
||||||
|
],
|
||||||
name_localizations: localizationObject(
|
name_localizations: localizationObject(
|
||||||
`common.nations.${nation}`,
|
(strings) =>
|
||||||
|
(strings.common.nations as Record<string, string>)[
|
||||||
|
nation
|
||||||
|
],
|
||||||
),
|
),
|
||||||
}) satisfies APIApplicationCommandOptionChoice,
|
}) satisfies APIApplicationCommandOptionChoice,
|
||||||
),
|
),
|
||||||
@@ -50,16 +60,18 @@ export function addFilterOptions<
|
|||||||
.addStringOption((option) => addTierChoices(option).setRequired(false))
|
.addStringOption((option) => addTierChoices(option).setRequired(false))
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(translate('bot.common.options.filters.tank_class'))
|
.setName(strings.bot.common.options.filters.class.name)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject('bot.common.options.filters.tank_class'),
|
localizationObject(
|
||||||
)
|
(strings) => strings.bot.common.options.filters.class.name,
|
||||||
.setDescription(
|
undefined,
|
||||||
translate('bot.common.options.filters.tank_class.description'),
|
true,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
.setDescription(strings.bot.common.options.filters.class.description)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.common.options.filters.tank_class.description',
|
(strings) => strings.bot.common.options.filters.class.description,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.addChoices(
|
.addChoices(
|
||||||
@@ -67,9 +79,9 @@ export function addFilterOptions<
|
|||||||
(tankType) =>
|
(tankType) =>
|
||||||
({
|
({
|
||||||
value: `${tankType}`,
|
value: `${tankType}`,
|
||||||
name: translate(`common.tank_class_short.${tankType}`),
|
name: strings.common.tank_class_short[tankType],
|
||||||
name_localizations: localizationObject(
|
name_localizations: localizationObject(
|
||||||
`common.tank_class_short.${tankType}`,
|
(strings) => strings.common.tank_class_short[tankType],
|
||||||
),
|
),
|
||||||
}) satisfies APIApplicationCommandOptionChoice,
|
}) satisfies APIApplicationCommandOptionChoice,
|
||||||
),
|
),
|
||||||
@@ -78,16 +90,18 @@ export function addFilterOptions<
|
|||||||
)
|
)
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(translate('bot.common.options.filters.tree_type'))
|
.setName(strings.bot.common.options.filters.type.name)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject('bot.common.options.filters.tree_type'),
|
localizationObject(
|
||||||
)
|
(strings) => strings.bot.common.options.filters.type.name,
|
||||||
.setDescription(
|
undefined,
|
||||||
translate('bot.common.options.filters.tree_type.description'),
|
true,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
.setDescription(strings.bot.common.options.filters.type.description)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
'bot.common.options.filters.tree_type.description',
|
(strings) => strings.bot.common.options.filters.type.description,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.addChoices(
|
.addChoices(
|
||||||
@@ -95,9 +109,9 @@ export function addFilterOptions<
|
|||||||
(treeType) =>
|
(treeType) =>
|
||||||
({
|
({
|
||||||
value: TANK_TYPE_COMMAND_NAMES[treeType],
|
value: TANK_TYPE_COMMAND_NAMES[treeType],
|
||||||
name: translate(`common.tree_type.${treeType}`),
|
name: strings.common.tree_type[treeType],
|
||||||
name_localizations: localizationObject(
|
name_localizations: localizationObject(
|
||||||
`common.tree_type.${treeType}`,
|
(strings) => strings.common.tree_type[treeType],
|
||||||
),
|
),
|
||||||
}) satisfies APIApplicationCommandOptionChoice,
|
}) satisfies APIApplicationCommandOptionChoice,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -16,31 +16,67 @@ export function addPeriodSubCommands(
|
|||||||
option: SlashCommandSubcommandBuilder,
|
option: SlashCommandSubcommandBuilder,
|
||||||
) => SlashCommandSubcommandBuilder = (option) => option,
|
) => SlashCommandSubcommandBuilder = (option) => option,
|
||||||
) {
|
) {
|
||||||
const { translate } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
const subcommandNameLocalizations = {
|
const subcommandNameLocalizations = {
|
||||||
today: localizationObject('bot.common.subcommands.today'),
|
today: localizationObject(
|
||||||
30: localizationObject('bot.common.subcommands.30'),
|
(strings) => strings.bot.common.subcommands.today.name,
|
||||||
60: localizationObject('bot.common.subcommands.60'),
|
undefined,
|
||||||
90: localizationObject('bot.common.subcommands.90'),
|
true,
|
||||||
career: localizationObject('bot.common.subcommands.career'),
|
),
|
||||||
custom: localizationObject('bot.common.subcommands.custom'),
|
30: localizationObject(
|
||||||
|
(strings) => strings.bot.common.subcommands[30].name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
60: localizationObject(
|
||||||
|
(strings) => strings.bot.common.subcommands[60].name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
90: localizationObject(
|
||||||
|
(strings) => strings.bot.common.subcommands[90].name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
career: localizationObject(
|
||||||
|
(strings) => strings.bot.common.subcommands.career.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
custom: localizationObject(
|
||||||
|
(strings) => strings.bot.common.subcommands.custom.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
const subcommandDescriptionLocalizations = {
|
const subcommandDescriptionLocalizations = {
|
||||||
today: localizationObject('bot.common.subcommands.today.description'),
|
today: localizationObject(
|
||||||
30: localizationObject('bot.common.subcommands.30.description'),
|
(strings) => strings.bot.common.subcommands.today.description,
|
||||||
60: localizationObject('bot.common.subcommands.60.description'),
|
),
|
||||||
90: localizationObject('bot.common.subcommands.90.description'),
|
30: localizationObject(
|
||||||
career: localizationObject('bot.common.subcommands.career.description'),
|
(strings) => strings.bot.common.subcommands[30].description,
|
||||||
custom: localizationObject('bot.common.subcommands.custom.description'),
|
),
|
||||||
|
60: localizationObject(
|
||||||
|
(strings) => strings.bot.common.subcommands[60].description,
|
||||||
|
),
|
||||||
|
90: localizationObject(
|
||||||
|
(strings) => strings.bot.common.subcommands[90].description,
|
||||||
|
),
|
||||||
|
career: localizationObject(
|
||||||
|
(strings) => strings.bot.common.subcommands.career.description,
|
||||||
|
),
|
||||||
|
custom: localizationObject(
|
||||||
|
(strings) => strings.bot.common.subcommands.custom.description,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
option
|
option
|
||||||
.addSubcommand((option) =>
|
.addSubcommand((option) =>
|
||||||
extra(
|
extra(
|
||||||
option
|
option
|
||||||
.setName(translate('bot.common.subcommands.today'))
|
.setName(strings.bot.common.subcommands.today.name)
|
||||||
.setNameLocalizations(subcommandNameLocalizations.today)
|
.setNameLocalizations(subcommandNameLocalizations.today)
|
||||||
.setDescription(translate('bot.common.subcommands.today.description'))
|
.setDescription(strings.bot.common.subcommands.today.description)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
subcommandDescriptionLocalizations.today,
|
subcommandDescriptionLocalizations.today,
|
||||||
),
|
),
|
||||||
@@ -49,38 +85,36 @@ export function addPeriodSubCommands(
|
|||||||
.addSubcommand((option) =>
|
.addSubcommand((option) =>
|
||||||
extra(
|
extra(
|
||||||
option
|
option
|
||||||
.setName(translate('bot.common.subcommands.30'))
|
.setName(strings.bot.common.subcommands[30].name)
|
||||||
.setNameLocalizations(subcommandNameLocalizations[30])
|
.setNameLocalizations(subcommandNameLocalizations[30])
|
||||||
.setDescription(translate('bot.common.subcommands.30.description'))
|
.setDescription(strings.bot.common.subcommands[30].description)
|
||||||
.setDescriptionLocalizations(subcommandDescriptionLocalizations[30]),
|
.setDescriptionLocalizations(subcommandDescriptionLocalizations[30]),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.addSubcommand((option) =>
|
.addSubcommand((option) =>
|
||||||
extra(
|
extra(
|
||||||
option
|
option
|
||||||
.setName(translate('bot.common.subcommands.60'))
|
.setName(strings.bot.common.subcommands[60].name)
|
||||||
.setNameLocalizations(subcommandNameLocalizations[60])
|
.setNameLocalizations(subcommandNameLocalizations[60])
|
||||||
.setDescription(translate('bot.common.subcommands.60.description'))
|
.setDescription(strings.bot.common.subcommands[60].description)
|
||||||
.setDescriptionLocalizations(subcommandDescriptionLocalizations[60]),
|
.setDescriptionLocalizations(subcommandDescriptionLocalizations[60]),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.addSubcommand((option) =>
|
.addSubcommand((option) =>
|
||||||
extra(
|
extra(
|
||||||
option
|
option
|
||||||
.setName(translate('bot.common.subcommands.90'))
|
.setName(strings.bot.common.subcommands[90].name)
|
||||||
.setNameLocalizations(subcommandNameLocalizations[90])
|
.setNameLocalizations(subcommandNameLocalizations[90])
|
||||||
.setDescription(translate('bot.common.subcommands.90.description'))
|
.setDescription(strings.bot.common.subcommands[90].description)
|
||||||
.setDescriptionLocalizations(subcommandDescriptionLocalizations[90]),
|
.setDescriptionLocalizations(subcommandDescriptionLocalizations[90]),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.addSubcommand((option) =>
|
.addSubcommand((option) =>
|
||||||
extra(
|
extra(
|
||||||
option
|
option
|
||||||
.setName(translate('bot.common.subcommands.career'))
|
.setName(strings.bot.common.subcommands.career.name)
|
||||||
.setNameLocalizations(subcommandNameLocalizations.career)
|
.setNameLocalizations(subcommandNameLocalizations.career)
|
||||||
.setDescription(
|
.setDescription(strings.bot.common.subcommands.career.description)
|
||||||
translate('bot.common.subcommands.career.description'),
|
|
||||||
)
|
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
subcommandDescriptionLocalizations.career,
|
subcommandDescriptionLocalizations.career,
|
||||||
),
|
),
|
||||||
@@ -89,31 +123,25 @@ export function addPeriodSubCommands(
|
|||||||
.addSubcommand((option) =>
|
.addSubcommand((option) =>
|
||||||
extra(
|
extra(
|
||||||
option
|
option
|
||||||
.setName(translate('bot.common.subcommands.custom'))
|
.setName(strings.bot.common.subcommands.custom.name)
|
||||||
.setNameLocalizations(subcommandNameLocalizations.custom)
|
.setNameLocalizations(subcommandNameLocalizations.custom)
|
||||||
.setDescription(
|
.setDescription(strings.bot.common.subcommands.custom.description)
|
||||||
translate('bot.common.subcommands.custom.description'),
|
|
||||||
)
|
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
subcommandDescriptionLocalizations.custom,
|
subcommandDescriptionLocalizations.custom,
|
||||||
)
|
)
|
||||||
.addIntegerOption((option) =>
|
.addIntegerOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(translate('bot.common.subcommands.custom.options.start'))
|
.setName(strings.bot.common.subcommands.custom.options.start.name)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
translate(
|
strings.bot.common.subcommands.custom.options.start.description,
|
||||||
'bot.common.subcommands.custom.options.start.description',
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.setRequired(true),
|
.setRequired(true),
|
||||||
)
|
)
|
||||||
.addIntegerOption((option) =>
|
.addIntegerOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(translate('bot.common.subcommands.custom.options.end'))
|
.setName(strings.bot.common.subcommands.custom.options.end.name)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
translate(
|
strings.bot.common.subcommands.custom.options.end.description,
|
||||||
'bot.common.subcommands.custom.options.end.description',
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.setRequired(true),
|
.setRequired(true),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -8,23 +8,31 @@ import { translator } from '../localization/translator';
|
|||||||
import { localizationObject } from './localizationObject';
|
import { localizationObject } from './localizationObject';
|
||||||
|
|
||||||
export function addRegionChoices(option: SlashCommandStringOption) {
|
export function addRegionChoices(option: SlashCommandStringOption) {
|
||||||
const { t, translate } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
return option
|
return option
|
||||||
.setName(t`bot.common.options.region`)
|
.setName(strings.bot.common.options.region.name)
|
||||||
.setNameLocalizations(localizationObject('bot.common.options.region'))
|
.setNameLocalizations(
|
||||||
.setDescription(t`bot.common.options.region.description`)
|
localizationObject(
|
||||||
|
(strings) => strings.bot.common.options.region.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.setDescription(strings.bot.common.options.region.description)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject('bot.common.options.region.description'),
|
localizationObject(
|
||||||
|
(strings) => strings.bot.common.options.region.description,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.addChoices(
|
.addChoices(
|
||||||
...REGIONS.map(
|
...REGIONS.map(
|
||||||
(region) =>
|
(region) =>
|
||||||
({
|
({
|
||||||
value: region,
|
value: region,
|
||||||
name: translate(`common.regions.normal.${region}`),
|
name: strings.common.regions.normal[region],
|
||||||
name_localizations: localizationObject(
|
name_localizations: localizationObject(
|
||||||
`common.regions.normal.${region}`,
|
(strings) => strings.common.regions.normal[region],
|
||||||
),
|
),
|
||||||
}) satisfies APIApplicationCommandOptionChoice,
|
}) satisfies APIApplicationCommandOptionChoice,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,14 +3,22 @@ import { translator } from '../localization/translator';
|
|||||||
import { localizationObject } from './localizationObject';
|
import { localizationObject } from './localizationObject';
|
||||||
|
|
||||||
export function addTankChoices(option: SlashCommandStringOption) {
|
export function addTankChoices(option: SlashCommandStringOption) {
|
||||||
const { translate } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
return option
|
return option
|
||||||
.setName(translate('bot.common.options.tank'))
|
.setName(strings.bot.common.options.tank.name)
|
||||||
.setNameLocalizations(localizationObject('bot.common.options.tank'))
|
.setNameLocalizations(
|
||||||
.setDescription(translate('bot.common.options.tank.description'))
|
localizationObject(
|
||||||
|
(strings) => strings.bot.common.options.tank.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.setDescription(strings.bot.common.options.tank.description)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject('bot.common.options.tank.description'),
|
localizationObject(
|
||||||
|
(strings) => strings.bot.common.options.tank.description,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.setAutocomplete(true)
|
.setAutocomplete(true)
|
||||||
.setRequired(true);
|
.setRequired(true);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { numberToRomanNumeral } from '@blitzkit/core';
|
import { numberToRomanNumeral } from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import {
|
import {
|
||||||
APIApplicationCommandOptionChoice,
|
APIApplicationCommandOptionChoice,
|
||||||
Locale,
|
Locale,
|
||||||
@@ -9,26 +10,34 @@ import { translator } from '../localization/translator';
|
|||||||
import { localizationObject } from './localizationObject';
|
import { localizationObject } from './localizationObject';
|
||||||
|
|
||||||
export function addTierChoices(option: SlashCommandStringOption) {
|
export function addTierChoices(option: SlashCommandStringOption) {
|
||||||
const { t, translate } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
return option
|
return option
|
||||||
.setName(t`bot.common.options.tier`)
|
.setName(strings.bot.common.options.tier.name)
|
||||||
.setNameLocalizations(localizationObject('bot.common.options.tier'))
|
.setNameLocalizations(
|
||||||
.setDescription(t`bot.common.options.tier.description`)
|
localizationObject(
|
||||||
|
(strings) => strings.bot.common.options.tier.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.setDescription(strings.bot.common.options.tier.description)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject('bot.common.options.tier.description'),
|
localizationObject(
|
||||||
|
(strings) => strings.bot.common.options.tier.description,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.setChoices(
|
.setChoices(
|
||||||
...range(10, 0).map(
|
...range(10, 0).map(
|
||||||
(tier) =>
|
(tier) =>
|
||||||
({
|
({
|
||||||
name: translate('bot.common.options.tier.choices.tier', [
|
name: literals(strings.bot.common.options.tier.choices.tier, [
|
||||||
`${tier}`,
|
`${tier}`,
|
||||||
numberToRomanNumeral(tier),
|
numberToRomanNumeral(tier),
|
||||||
]),
|
]),
|
||||||
value: `${tier}`,
|
value: `${tier}`,
|
||||||
name_localizations: localizationObject(
|
name_localizations: localizationObject(
|
||||||
'bot.common.options.tier.choices.tier',
|
(strings) => strings.bot.common.options.tier.choices.tier,
|
||||||
[`${tier}`, numberToRomanNumeral(tier)],
|
[`${tier}`, numberToRomanNumeral(tier)],
|
||||||
),
|
),
|
||||||
}) satisfies APIApplicationCommandOptionChoice,
|
}) satisfies APIApplicationCommandOptionChoice,
|
||||||
|
|||||||
@@ -3,14 +3,22 @@ import { translator } from '../localization/translator';
|
|||||||
import { localizationObject } from './localizationObject';
|
import { localizationObject } from './localizationObject';
|
||||||
|
|
||||||
export function addUsernameChoices(option: SlashCommandStringOption) {
|
export function addUsernameChoices(option: SlashCommandStringOption) {
|
||||||
const { t } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
return option
|
return option
|
||||||
.setName(t`bot.common.options.username`)
|
.setName(strings.bot.common.options.username.name)
|
||||||
.setNameLocalizations(localizationObject('bot.common.options.username'))
|
.setNameLocalizations(
|
||||||
.setDescription(t`bot.common.options.username.description`)
|
localizationObject(
|
||||||
|
(strings) => strings.bot.common.options.username.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.setDescription(strings.bot.common.options.username.description)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject('bot.common.options.username.description'),
|
localizationObject(
|
||||||
|
(strings) => strings.bot.common.options.username.description,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.setAutocomplete(true);
|
.setAutocomplete(true);
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ import { DISCORD_CHOICES_MAX_NAME_SIZE, OVERFLOW_SUFFIX } from './constants';
|
|||||||
export async function autocompleteClan(
|
export async function autocompleteClan(
|
||||||
interaction: AutocompleteInteraction<CacheType>,
|
interaction: AutocompleteInteraction<CacheType>,
|
||||||
) {
|
) {
|
||||||
const { translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const focusedOption = interaction.options.getFocused(true);
|
const focusedOption = interaction.options.getFocused(true);
|
||||||
if (focusedOption.name !== 'clan') return;
|
if (focusedOption.name !== 'clan') return;
|
||||||
if (focusedOption.value.length < 2) return interaction.respond([]);
|
if (focusedOption.value.length < 2) return interaction.respond([]);
|
||||||
@@ -19,9 +19,7 @@ export async function autocompleteClan(
|
|||||||
await interaction.respond(
|
await interaction.respond(
|
||||||
clans
|
clans
|
||||||
? clans.map((clan) => {
|
? clans.map((clan) => {
|
||||||
let name = `${clan.name} (${translate(
|
let name = `${clan.name} (${strings.common.regions.short[clan.region]})`;
|
||||||
`common.regions.short.${clan.region}`,
|
|
||||||
)})`;
|
|
||||||
|
|
||||||
if (name.length > DISCORD_CHOICES_MAX_NAME_SIZE) {
|
if (name.length > DISCORD_CHOICES_MAX_NAME_SIZE) {
|
||||||
const overSize = name.length - DISCORD_CHOICES_MAX_NAME_SIZE;
|
const overSize = name.length - DISCORD_CHOICES_MAX_NAME_SIZE;
|
||||||
@@ -29,9 +27,7 @@ export async function autocompleteClan(
|
|||||||
name = `${clan.name.slice(
|
name = `${clan.name.slice(
|
||||||
0,
|
0,
|
||||||
clan.name.length - overSize - OVERFLOW_SUFFIX.length,
|
clan.name.length - overSize - OVERFLOW_SUFFIX.length,
|
||||||
)}${OVERFLOW_SUFFIX} (${translate(
|
)}${OVERFLOW_SUFFIX} (${strings.common.regions.short[clan.region]})`;
|
||||||
`common.regions.short.${clan.region}`,
|
|
||||||
)})`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
import { fetchTankNames, TankType } from '@blitzkit/core';
|
import { fetchTankNames, SEARCH_KEYS, TankType } from '@blitzkit/core';
|
||||||
import {
|
import {
|
||||||
ApplicationCommandOptionChoiceData,
|
ApplicationCommandOptionChoiceData,
|
||||||
AutocompleteInteraction,
|
AutocompleteInteraction,
|
||||||
CacheType,
|
CacheType,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { go } from 'fuzzysort';
|
import { go } from 'fuzzysort';
|
||||||
|
import { tankNames } from '../blitzkit/nonBlockingPromises';
|
||||||
|
import { translator } from '../localization/translator';
|
||||||
import {
|
import {
|
||||||
DISCORD_CHOICES_MAX_NAME_SIZE,
|
DISCORD_CHOICES_MAX_NAME_SIZE,
|
||||||
OVERFLOW_SUFFIX,
|
OVERFLOW_SUFFIX,
|
||||||
} from './autocompleteClan/constants';
|
} from './autocompleteClan/constants';
|
||||||
import { tankNames } from '../blitzkit/nonBlockingPromises';
|
|
||||||
|
|
||||||
export const tankNamesTechTreeOnly = fetchTankNames().then((names) =>
|
export const tankNamesTechTreeOnly = fetchTankNames().then((names) =>
|
||||||
names.filter((tank) => tank.treeType === TankType.RESEARCHABLE),
|
names.filter((tank) => tank.treeType === TankType.RESEARCHABLE),
|
||||||
@@ -20,6 +21,7 @@ export async function autocompleteTanks(
|
|||||||
techTreeOnly = false,
|
techTreeOnly = false,
|
||||||
fields = ['tank'],
|
fields = ['tank'],
|
||||||
) {
|
) {
|
||||||
|
const { unwrap } = translator(interaction.locale);
|
||||||
const focusedOption = interaction.options.getFocused(true);
|
const focusedOption = interaction.options.getFocused(true);
|
||||||
if (!fields.includes(focusedOption.name)) return;
|
if (!fields.includes(focusedOption.name)) return;
|
||||||
|
|
||||||
@@ -29,19 +31,16 @@ export async function autocompleteTanks(
|
|||||||
go(
|
go(
|
||||||
focusedOption.value,
|
focusedOption.value,
|
||||||
await (techTreeOnly ? tankNamesTechTreeOnly : tankNames),
|
await (techTreeOnly ? tankNamesTechTreeOnly : tankNames),
|
||||||
{
|
{ keys: SEARCH_KEYS, limit: 10 },
|
||||||
keys: ['searchableName', 'searchableNameDeburr', 'camouflages'],
|
|
||||||
limit: 10,
|
|
||||||
},
|
|
||||||
).map(async (item) => {
|
).map(async (item) => {
|
||||||
let name = item.obj.searchableName;
|
let name = unwrap(item.obj.searchableName);
|
||||||
|
|
||||||
if (name.length > DISCORD_CHOICES_MAX_NAME_SIZE) {
|
if (name.length > DISCORD_CHOICES_MAX_NAME_SIZE) {
|
||||||
const overSize = name.length - DISCORD_CHOICES_MAX_NAME_SIZE;
|
const overSize = name.length - DISCORD_CHOICES_MAX_NAME_SIZE;
|
||||||
|
|
||||||
name = `${item.obj.searchableName.slice(
|
name = `${unwrap(item.obj.searchableName).slice(
|
||||||
0,
|
0,
|
||||||
item.obj.searchableName.length -
|
unwrap(item.obj.searchableName).length -
|
||||||
overSize -
|
overSize -
|
||||||
OVERFLOW_SUFFIX.length,
|
OVERFLOW_SUFFIX.length,
|
||||||
)}${OVERFLOW_SUFFIX}`;
|
)}${OVERFLOW_SUFFIX}`;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
export async function autocompleteUsername(
|
export async function autocompleteUsername(
|
||||||
interaction: AutocompleteInteraction<CacheType>,
|
interaction: AutocompleteInteraction<CacheType>,
|
||||||
) {
|
) {
|
||||||
const { translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const focusedOption = interaction.options.getFocused(true);
|
const focusedOption = interaction.options.getFocused(true);
|
||||||
if (focusedOption.name !== 'username') return;
|
if (focusedOption.name !== 'username') return;
|
||||||
const players = await searchPlayersAcrossRegions(focusedOption.value);
|
const players = await searchPlayersAcrossRegions(focusedOption.value);
|
||||||
@@ -22,9 +22,9 @@ export async function autocompleteUsername(
|
|||||||
await interaction.respond(
|
await interaction.respond(
|
||||||
players
|
players
|
||||||
? players.map((player) => {
|
? players.map((player) => {
|
||||||
let name = `${player.nickname} (${translate(
|
let name = `${player.nickname} (${
|
||||||
`common.regions.short.${player.region}`,
|
strings.common.regions.short[player.region]
|
||||||
)})`;
|
})`;
|
||||||
|
|
||||||
if (name.length > DISCORD_CHOICES_MAX_NAME_SIZE) {
|
if (name.length > DISCORD_CHOICES_MAX_NAME_SIZE) {
|
||||||
const overSize = name.length - DISCORD_CHOICES_MAX_NAME_SIZE;
|
const overSize = name.length - DISCORD_CHOICES_MAX_NAME_SIZE;
|
||||||
@@ -32,9 +32,9 @@ export async function autocompleteUsername(
|
|||||||
name = `${player.nickname.slice(
|
name = `${player.nickname.slice(
|
||||||
0,
|
0,
|
||||||
player.nickname.length - overSize - OVERFLOW_SUFFIX.length,
|
player.nickname.length - overSize - OVERFLOW_SUFFIX.length,
|
||||||
)}${OVERFLOW_SUFFIX} (${translate(
|
)}${OVERFLOW_SUFFIX} (${
|
||||||
`common.regions.short.${player.region}`,
|
strings.common.regions.short[player.region]
|
||||||
)})`;
|
})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ export function buttonRefresh(
|
|||||||
interaction: ChatInputCommandInteraction,
|
interaction: ChatInputCommandInteraction,
|
||||||
path: string,
|
path: string,
|
||||||
) {
|
) {
|
||||||
const { t } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
interaction.appPermissions?.has('ReadMessageHistory') &&
|
interaction.appPermissions?.has('ReadMessageHistory') &&
|
||||||
interaction.appPermissions?.has('ViewChannel')
|
interaction.appPermissions?.has('ViewChannel')
|
||||||
) {
|
) {
|
||||||
return buttonPrimary(path, t`bot.common.buttons.refresh`);
|
return buttonPrimary(path, strings.bot.common.buttons.refresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
export function chunkLines(lines: string[], joiner = '\n', maxSize = 2000) {
|
||||||
|
const chunks = [''];
|
||||||
|
|
||||||
|
lines.map((line) => {
|
||||||
|
if (chunks.at(-1)!.length + line.length > maxSize) {
|
||||||
|
chunks.push('');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chunks.at(-1)!.length === 0) {
|
||||||
|
chunks[chunks.length - 1] += line;
|
||||||
|
} else {
|
||||||
|
chunks[chunks.length - 1] += joiner + line;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return chunks;
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { BlitzKitStrings } from '@blitzkit/i18n';
|
||||||
import {
|
import {
|
||||||
Locale,
|
Locale,
|
||||||
SlashCommandBuilder,
|
SlashCommandBuilder,
|
||||||
@@ -23,24 +24,47 @@ export function createLocalizedCommand(
|
|||||||
| CreateLocalizedCommandSubcommand[]
|
| CreateLocalizedCommandSubcommand[]
|
||||||
| CreateLocalizedCommandSubcommandGroup[],
|
| CreateLocalizedCommandSubcommandGroup[],
|
||||||
) {
|
) {
|
||||||
const commandPathItem = command.replaceAll('-', '_');
|
const commandPathItem = command.replaceAll(
|
||||||
const { translate } = translator(Locale.EnglishUS);
|
'-',
|
||||||
|
'_',
|
||||||
|
) as keyof BlitzKitStrings['bot']['commands'];
|
||||||
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
const slashCommand = new SlashCommandBuilder()
|
const slashCommand = new SlashCommandBuilder()
|
||||||
.setName(command)
|
.setName(command)
|
||||||
.setNameLocalizations(localizationObject(`bot.commands.${commandPathItem}`))
|
.setNameLocalizations(
|
||||||
.setDescription(translate(`bot.commands.${commandPathItem}.description`))
|
localizationObject(
|
||||||
|
(strings) => strings.bot.commands[commandPathItem].name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.setDescription(strings.bot.commands[commandPathItem].description)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(`bot.commands.${commandPathItem}.description`),
|
localizationObject(
|
||||||
|
(strings) => strings.bot.commands[commandPathItem].description,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (sub) {
|
if (sub) {
|
||||||
sub.map((subItem) => {
|
sub.map((subItem) => {
|
||||||
if ('subcommand' in subItem) {
|
if ('subcommand' in subItem) {
|
||||||
const subcommandNameLocalizations = localizationObject(
|
const subcommandNameLocalizations = localizationObject(
|
||||||
`bot.commands.${commandPathItem}.subcommands.${subItem.subcommand}`,
|
(strings) =>
|
||||||
|
(
|
||||||
|
strings.bot.commands[commandPathItem] as unknown as {
|
||||||
|
subcommands: Record<string, { name: string }>;
|
||||||
|
}
|
||||||
|
).subcommands[subItem.subcommand].name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
);
|
);
|
||||||
const subcommandDescriptionLocalizations = localizationObject(
|
const subcommandDescriptionLocalizations = localizationObject(
|
||||||
`bot.commands.${commandPathItem}.subcommands.${subItem.subcommand}.description`,
|
(strings) =>
|
||||||
|
(
|
||||||
|
strings.bot.commands[commandPathItem] as unknown as {
|
||||||
|
subcommands: Record<string, { description: string }>;
|
||||||
|
}
|
||||||
|
).subcommands[subItem.subcommand].description,
|
||||||
);
|
);
|
||||||
|
|
||||||
slashCommand.addSubcommand((option) => {
|
slashCommand.addSubcommand((option) => {
|
||||||
@@ -50,18 +74,32 @@ export function createLocalizedCommand(
|
|||||||
.setName(subItem.subcommand)
|
.setName(subItem.subcommand)
|
||||||
.setNameLocalizations(subcommandNameLocalizations)
|
.setNameLocalizations(subcommandNameLocalizations)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
translate(
|
(
|
||||||
`bot.commands.${commandPathItem}.subcommands.${subItem.subcommand}.description`,
|
strings.bot.commands[commandPathItem] as unknown as {
|
||||||
),
|
subcommands: Record<string, { description: string }>;
|
||||||
|
}
|
||||||
|
).subcommands[subItem.subcommand].description,
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(subcommandDescriptionLocalizations);
|
.setDescriptionLocalizations(subcommandDescriptionLocalizations);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const subcommandNameLocalizations = localizationObject(
|
const subcommandNameLocalizations = localizationObject(
|
||||||
`bot.commands.${commandPathItem}.groups.${subItem.group}`,
|
(strings) =>
|
||||||
|
(
|
||||||
|
strings.bot.commands[commandPathItem] as unknown as {
|
||||||
|
groups: Record<string, { name: string }>;
|
||||||
|
}
|
||||||
|
).groups[subItem.group].name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
);
|
);
|
||||||
const subcommandDescriptionLocalizations = localizationObject(
|
const subcommandDescriptionLocalizations = localizationObject(
|
||||||
`bot.commands.${commandPathItem}.groups.${subItem.group}.description`,
|
(strings) =>
|
||||||
|
(
|
||||||
|
strings.bot.commands[commandPathItem] as unknown as {
|
||||||
|
groups: Record<string, { description: string }>;
|
||||||
|
}
|
||||||
|
).groups[subItem.group].description,
|
||||||
);
|
);
|
||||||
|
|
||||||
slashCommand.addSubcommandGroup((option) => {
|
slashCommand.addSubcommandGroup((option) => {
|
||||||
@@ -71,9 +109,11 @@ export function createLocalizedCommand(
|
|||||||
.setName(subItem.group)
|
.setName(subItem.group)
|
||||||
.setNameLocalizations(subcommandNameLocalizations)
|
.setNameLocalizations(subcommandNameLocalizations)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
translate(
|
(
|
||||||
`bot.commands.${commandPathItem}.groups.${subItem.group}.description`,
|
strings.bot.commands[commandPathItem] as unknown as {
|
||||||
),
|
groups: Record<string, { description: string }>;
|
||||||
|
}
|
||||||
|
).groups[subItem.group].description,
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(subcommandDescriptionLocalizations);
|
.setDescriptionLocalizations(subcommandDescriptionLocalizations);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { Locale } from 'discord.js';
|
import { Locale } from 'discord.js';
|
||||||
import { translator } from '../localization/translator';
|
import { translator } from '../localization/translator';
|
||||||
import { PeriodSize } from './addPeriodSubCommands';
|
import { PeriodSize } from './addPeriodSubCommands';
|
||||||
|
|
||||||
export function getPeriodOptionName(period: PeriodSize, locale: Locale) {
|
export function getPeriodOptionName(period: PeriodSize, locale: Locale) {
|
||||||
const { translate } = translator(locale);
|
const { strings } = translator(locale);
|
||||||
if (period === 'career') return translate('bot.common.periods.career');
|
if (period === 'career') return strings.bot.common.periods.career;
|
||||||
if (period === 'today') return translate('bot.common.periods.today');
|
if (period === 'today') return strings.bot.common.periods.today;
|
||||||
return translate('bot.common.periods.days', [period]);
|
return literals(strings.bot.common.periods.days, [period]);
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,33 @@
|
|||||||
|
import { BlitzKitStrings, literals as literalsFunc } from '@blitzkit/i18n';
|
||||||
import { Locale } from 'discord.js';
|
import { Locale } from 'discord.js';
|
||||||
import { SUPPORTED_LOCALES } from '../localization/strings/constants';
|
import { SUPPORTED_LOCALES_DISCORD } from '../localization/strings/constants';
|
||||||
import { translator } from '../localization/translator';
|
import { translator } from '../localization/translator';
|
||||||
|
|
||||||
export function localizationObject(path: string, literals?: string[]) {
|
const validNameRegex =
|
||||||
return SUPPORTED_LOCALES.reduce<Partial<Record<Locale, string>>>(
|
/^[\p{Ll}\p{Lm}\p{Lo}\p{N}\p{sc=Devanagari}\p{sc=Thai}_-]+$/u;
|
||||||
|
|
||||||
|
export function localizationObject(
|
||||||
|
path: (strings: BlitzKitStrings) => string,
|
||||||
|
literals: string[] = [],
|
||||||
|
strict = false,
|
||||||
|
) {
|
||||||
|
return SUPPORTED_LOCALES_DISCORD.reduce<Partial<Record<Locale, string>>>(
|
||||||
(localizations, locale) => {
|
(localizations, locale) => {
|
||||||
const { translate } = translator(locale);
|
const { strings } = translator(locale);
|
||||||
|
const translation = literalsFunc(path(strings), literals);
|
||||||
|
const isValid =
|
||||||
|
(!strict || validNameRegex.test(translation)) && translation.length > 0;
|
||||||
|
|
||||||
|
if (!isValid) {
|
||||||
|
console.warn(
|
||||||
|
`Invalid localization for ${locale} (${path}): ${translation}; skipping...`,
|
||||||
|
);
|
||||||
|
return localizations;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...localizations,
|
...localizations,
|
||||||
[locale]: translate(path, literals),
|
[locale]: translation,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
import { assertSecret } from '@blitzkit/core';
|
|
||||||
import { ShardingManager } from 'discord.js';
|
|
||||||
|
|
||||||
export const manager = new ShardingManager('dist/bot/workers/bot.js', {
|
|
||||||
token: assertSecret(import.meta.env.DISCORD_TOKEN),
|
|
||||||
});
|
|
||||||
File renamed without changes.
@@ -1,6 +1,8 @@
|
|||||||
import { Region, searchClansAcrossRegions } from '@blitzkit/core';
|
import { Region } from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { ChatInputCommandInteraction } from 'discord.js';
|
import { ChatInputCommandInteraction } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
|
import { searchClansAcrossRegionsBotWrapper } from '../blitz/searchClansAcrossRegionsBotWrapper';
|
||||||
import { UserError } from '../blitzkit/userError';
|
import { UserError } from '../blitzkit/userError';
|
||||||
import { translator } from '../localization/translator';
|
import { translator } from '../localization/translator';
|
||||||
|
|
||||||
@@ -9,20 +11,25 @@ export const serverAndIdPattern = /(com|eu|asia)\/[0-9]+/;
|
|||||||
export async function resolveClanFromCommand(
|
export async function resolveClanFromCommand(
|
||||||
interaction: ChatInputCommandInteraction,
|
interaction: ChatInputCommandInteraction,
|
||||||
) {
|
) {
|
||||||
const { translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const clan = interaction.options.getString('clan', true);
|
const clan = interaction.options.getString('clan', true);
|
||||||
|
|
||||||
if (serverAndIdPattern.test(clan)) {
|
if (serverAndIdPattern.test(clan)) {
|
||||||
const [server, accountId] = clan.split('/');
|
const [server, accountId] = clan.split('/');
|
||||||
return { region: server as Region, id: Number(accountId) };
|
return { region: server as Region, id: Number(accountId) };
|
||||||
} else {
|
} else {
|
||||||
const accounts = await searchClansAcrossRegions(clan);
|
const accounts = await searchClansAcrossRegionsBotWrapper(
|
||||||
|
clan,
|
||||||
|
interaction.locale,
|
||||||
|
);
|
||||||
|
|
||||||
if (accounts[0]) {
|
if (accounts[0]) {
|
||||||
return { region: accounts[0].region, id: accounts[0].clan_id };
|
return { region: accounts[0].region, id: accounts[0].clan_id };
|
||||||
} else {
|
} else {
|
||||||
throw new UserError(
|
throw new UserError(
|
||||||
translate('bot.common.errors.clan_not_found', [markdownEscape(clan)]),
|
literals(strings.bot.common.errors.clan_not_found, [
|
||||||
|
markdownEscape(clan),
|
||||||
|
]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { getTimeDaysAgo, Region } from '@blitzkit/core';
|
import { getTimeDaysAgo, Region } from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||||
import { getPeriodNow } from '../blitzkit/getPeriodNow';
|
import { getPeriodNow } from '../blitzkit/getPeriodNow';
|
||||||
import { getPeriodStart } from '../blitzkit/getPeriodStart';
|
import { getPeriodStart } from '../blitzkit/getPeriodStart';
|
||||||
@@ -17,7 +18,7 @@ export function resolvePeriodFromCommand(
|
|||||||
interaction: ChatInputCommandInteraction<CacheType>,
|
interaction: ChatInputCommandInteraction<CacheType>,
|
||||||
forcedPeriod?: PeriodType,
|
forcedPeriod?: PeriodType,
|
||||||
) {
|
) {
|
||||||
const { translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
let name: string;
|
let name: string;
|
||||||
let start: number;
|
let start: number;
|
||||||
let end: number;
|
let end: number;
|
||||||
@@ -31,7 +32,7 @@ export function resolvePeriodFromCommand(
|
|||||||
const startDaysAgoMin = Math.min(startOption, endOption);
|
const startDaysAgoMin = Math.min(startOption, endOption);
|
||||||
const endDaysAgoMax = Math.max(startOption, endOption);
|
const endDaysAgoMax = Math.max(startOption, endOption);
|
||||||
|
|
||||||
name = translate('bot.common.periods.custom', [
|
name = literals(strings.bot.common.periods.custom, [
|
||||||
`${startDaysAgoMin}`,
|
`${startDaysAgoMin}`,
|
||||||
`${endDaysAgoMax}`,
|
`${endDaysAgoMax}`,
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { idToRegion, Region, searchPlayersAcrossRegions } from '@blitzkit/core';
|
import { idToRegion, Region } from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
|
import { searchPlayersAcrossRegionsBotWrapper } from '../../blitz/searchPlayersAcrossRegionsBotWrapper';
|
||||||
import { getBlitzFromDiscord } from '../../blitzkit/getBlitzFromDiscord';
|
import { getBlitzFromDiscord } from '../../blitzkit/getBlitzFromDiscord';
|
||||||
import { UserError } from '../../blitzkit/userError';
|
import { UserError } from '../../blitzkit/userError';
|
||||||
import { translator } from '../../localization/translator';
|
import { translator } from '../../localization/translator';
|
||||||
@@ -13,7 +15,7 @@ export interface ResolvedPlayer {
|
|||||||
export async function resolvePlayerFromCommand(
|
export async function resolvePlayerFromCommand(
|
||||||
interaction: ChatInputCommandInteraction<CacheType>,
|
interaction: ChatInputCommandInteraction<CacheType>,
|
||||||
) {
|
) {
|
||||||
const { t, translate } = translator(interaction.locale);
|
const { strings } = translator(interaction.locale);
|
||||||
const commandUsername = interaction.options.getString('username');
|
const commandUsername = interaction.options.getString('username');
|
||||||
|
|
||||||
if (commandUsername !== null) {
|
if (commandUsername !== null) {
|
||||||
@@ -23,7 +25,10 @@ export async function resolvePlayerFromCommand(
|
|||||||
const region = idToRegion(id);
|
const region = idToRegion(id);
|
||||||
return { region, id } satisfies ResolvedPlayer;
|
return { region, id } satisfies ResolvedPlayer;
|
||||||
} else {
|
} else {
|
||||||
const accounts = await searchPlayersAcrossRegions(commandUsername);
|
const accounts = await searchPlayersAcrossRegionsBotWrapper(
|
||||||
|
commandUsername,
|
||||||
|
interaction.locale,
|
||||||
|
);
|
||||||
|
|
||||||
if (accounts[0]) {
|
if (accounts[0]) {
|
||||||
return {
|
return {
|
||||||
@@ -32,7 +37,7 @@ export async function resolvePlayerFromCommand(
|
|||||||
} satisfies ResolvedPlayer;
|
} satisfies ResolvedPlayer;
|
||||||
} else {
|
} else {
|
||||||
throw new UserError(
|
throw new UserError(
|
||||||
translate('bot.common.errors.player_not_found', [
|
literals(strings.bot.common.errors.player_not_found, [
|
||||||
markdownEscape(commandUsername),
|
markdownEscape(commandUsername),
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
@@ -43,6 +48,6 @@ export async function resolvePlayerFromCommand(
|
|||||||
|
|
||||||
if (account) return account;
|
if (account) return account;
|
||||||
|
|
||||||
throw new UserError(t`bot.common.errors.player_not_linked`);
|
throw new UserError(strings.bot.common.errors.player_not_linked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,25 @@
|
|||||||
|
import { DEFAULT_LOCALE, SupportedLocale } from '@blitzkit/i18n';
|
||||||
import { Locale } from 'discord.js';
|
import { Locale } from 'discord.js';
|
||||||
|
|
||||||
export const SUPPORTED_LOCALES: Locale[] = [Locale.EnglishUS, Locale.SpanishES];
|
const SUPPORTED_LOCALES_DISCORD_MAP: Record<SupportedLocale, Locale> = {
|
||||||
|
en: Locale.EnglishUS,
|
||||||
|
es: Locale.SpanishES,
|
||||||
|
pt: Locale.PortugueseBR,
|
||||||
|
ru: Locale.Russian,
|
||||||
|
uk: Locale.Ukrainian,
|
||||||
|
zh: Locale.ChineseCN,
|
||||||
|
fr: Locale.French,
|
||||||
|
ja: Locale.Japanese,
|
||||||
|
pl: Locale.Polish,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const SUPPORTED_LOCALES_DISCORD_MAP_INVERSE = Object.fromEntries(
|
||||||
|
Object.entries(SUPPORTED_LOCALES_DISCORD_MAP).map(([k, v]) => [v, k]),
|
||||||
|
) as Record<Locale, SupportedLocale>;
|
||||||
|
|
||||||
|
export const SUPPORTED_LOCALES_DISCORD = Object.values(
|
||||||
|
SUPPORTED_LOCALES_DISCORD_MAP,
|
||||||
|
);
|
||||||
|
|
||||||
|
export const DEFAULT_LOCALE_DISCORD =
|
||||||
|
SUPPORTED_LOCALES_DISCORD_MAP[DEFAULT_LOCALE];
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { Locale } from 'discord.js';
|
|
||||||
import { SUPPORTED_LOCALES } from './constants';
|
|
||||||
|
|
||||||
export type TranslationFragmentTree = {
|
|
||||||
[key: string]: TranslationFragment;
|
|
||||||
} & {
|
|
||||||
$?: string;
|
|
||||||
};
|
|
||||||
export type TranslationFragment = string | TranslationFragmentTree;
|
|
||||||
|
|
||||||
export const translations = SUPPORTED_LOCALES.reduce<
|
|
||||||
Partial<Record<Locale, TranslationFragment>>
|
|
||||||
>(
|
|
||||||
(table, locale) => ({
|
|
||||||
...table,
|
|
||||||
[locale]: require(`../../../../../core/lang/${locale}.json`),
|
|
||||||
}),
|
|
||||||
{},
|
|
||||||
);
|
|
||||||
@@ -1,74 +1,20 @@
|
|||||||
|
import { STRINGS, unwrapper } from '@blitzkit/i18n';
|
||||||
import { Locale } from 'discord.js';
|
import { Locale } from 'discord.js';
|
||||||
import { translations } from './strings';
|
import {
|
||||||
import { SUPPORTED_LOCALES } from './strings/constants';
|
DEFAULT_LOCALE_DISCORD,
|
||||||
|
SUPPORTED_LOCALES_DISCORD,
|
||||||
|
SUPPORTED_LOCALES_DISCORD_MAP_INVERSE,
|
||||||
|
} from './strings/constants';
|
||||||
|
|
||||||
export function translator(localeRaw: Locale) {
|
export function translator(localeRaw: Locale) {
|
||||||
const locale =
|
const locale =
|
||||||
localeRaw !== Locale.EnglishUS && SUPPORTED_LOCALES.includes(localeRaw)
|
localeRaw !== DEFAULT_LOCALE_DISCORD &&
|
||||||
|
SUPPORTED_LOCALES_DISCORD.includes(localeRaw)
|
||||||
? localeRaw
|
? localeRaw
|
||||||
: Locale.EnglishUS;
|
: DEFAULT_LOCALE_DISCORD;
|
||||||
const strings = translations[locale]!;
|
const bkLocale = SUPPORTED_LOCALES_DISCORD_MAP_INVERSE[locale];
|
||||||
|
const strings = STRINGS[bkLocale];
|
||||||
|
const unwrap = unwrapper(bkLocale);
|
||||||
|
|
||||||
function translate(path: string, literals?: string[]): string {
|
return { locale, strings, unwrap, bkLocale };
|
||||||
const pathArray = path.split('.');
|
|
||||||
let fragment = strings;
|
|
||||||
let resolvedString: string;
|
|
||||||
|
|
||||||
for (const pathItem of pathArray) {
|
|
||||||
if (typeof fragment === 'string') {
|
|
||||||
throw new SyntaxError(
|
|
||||||
`Attempted to access string with key "${pathItem}" in "${path}" from within a string instead of an object in locale "${locale}"`,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
fragment = fragment[pathItem];
|
|
||||||
|
|
||||||
if (typeof fragment === 'undefined') {
|
|
||||||
const message = `Undefined translation at "${pathItem}" in "${path}" for locale "${locale}"`;
|
|
||||||
|
|
||||||
if (locale === Locale.EnglishUS) {
|
|
||||||
throw new Error(message);
|
|
||||||
} else {
|
|
||||||
console.warn(`${message} falling back to en-US`);
|
|
||||||
return translator(Locale.EnglishUS).translate(path, literals);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof fragment === 'string') {
|
|
||||||
resolvedString = fragment;
|
|
||||||
} else if (fragment.$) {
|
|
||||||
resolvedString = fragment.$!;
|
|
||||||
} else {
|
|
||||||
throw new Error(
|
|
||||||
`Unresolved tree ending for "${path}" in locale "${locale}"`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (literals) {
|
|
||||||
const chunks = resolvedString.split('%s');
|
|
||||||
let embeddedString = '';
|
|
||||||
|
|
||||||
chunks.forEach((chunk, index) => {
|
|
||||||
if (index !== 0) embeddedString += literals[index - 1];
|
|
||||||
embeddedString += chunk;
|
|
||||||
});
|
|
||||||
|
|
||||||
return embeddedString;
|
|
||||||
}
|
|
||||||
|
|
||||||
return resolvedString;
|
|
||||||
}
|
|
||||||
|
|
||||||
function t(paths: TemplateStringsArray, ...embeds: string[]) {
|
|
||||||
return paths
|
|
||||||
.map((path, index) =>
|
|
||||||
path.length === 0
|
|
||||||
? ''
|
|
||||||
: `${translate(path)}${index === embeds.length ? '' : embeds[index]}`,
|
|
||||||
)
|
|
||||||
.join('');
|
|
||||||
}
|
|
||||||
|
|
||||||
return { locale, translate, t };
|
|
||||||
}
|
}
|
||||||
Loaded 100 of 635 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user