@skyhelperbot/utils 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -4
- package/dist/{classes → types/classes}/SkytimesUtils.d.ts +4 -5
- package/dist/types/classes/index.d.ts +3 -0
- package/dist/types/classes/shardsUtil.d.ts +77 -0
- package/dist/{classes → types/classes}/utils.d.ts +3 -0
- package/dist/types/constants/eventDatas.d.ts +31 -0
- package/dist/{constants → types/constants}/index.d.ts +1 -0
- package/dist/{constants → types/constants}/shardsInfo.d.ts +12 -16
- package/dist/{constants → types/constants}/shardsTimeline.d.ts +3 -2
- package/dist/{index.d.ts → types/index.d.ts} +1 -0
- package/dist/types/typings.d.ts +29 -0
- package/dist/types/utils/PermissionUtils.d.ts +84 -0
- package/dist/types/utils/getNextTs.d.ts +10 -0
- package/dist/types/utils/index.d.ts +16 -0
- package/dist/{utils → types/utils}/parseDateFormat.d.ts +1 -0
- package/dist/{utils → types/utils}/parsePerms.d.ts +2 -0
- package/dist/{utils → types/utils}/postToBin.d.ts +1 -0
- package/dist/{utils → types/utils}/recursiveReadDir.d.ts +1 -0
- package/dist/{utils → types/utils}/resolveColors.d.ts +1 -0
- package/dist/types/utils/v2-builders.d.ts +14 -0
- package/package.json +17 -11
- package/dist/classes/LeaderBoardCard.d.ts +0 -59
- package/dist/classes/LeaderBoardCard.js +0 -249
- package/dist/classes/SkytimesUtils.js +0 -116
- package/dist/classes/WinnerCard.d.ts +0 -13
- package/dist/classes/WinnerCard.js +0 -117
- package/dist/classes/index.d.ts +0 -5
- package/dist/classes/index.js +0 -5
- package/dist/classes/shardsUtil.d.ts +0 -40
- package/dist/classes/shardsUtil.js +0 -122
- package/dist/classes/utils.js +0 -28
- package/dist/constants/eventDatas.d.ts +0 -31
- package/dist/constants/eventDatas.js +0 -105
- package/dist/constants/index.js +0 -5
- package/dist/constants/shardsInfo.js +0 -424
- package/dist/constants/shardsTimeline.js +0 -46
- package/dist/typings.d.ts +0 -58
- package/dist/typings.js +0 -1
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/index.js +0 -5
- package/dist/utils/parseDateFormat.js +0 -25
- package/dist/utils/parsePerms.js +0 -54
- package/dist/utils/postToBin.js +0 -15
- package/dist/utils/recursiveReadDir.js +0 -37
- package/dist/utils/resolveColors.js +0 -63
- package/shared/assets/Point.png +0 -0
- package/shared/assets/Win.png +0 -0
- package/shared/assets/medal_champion_award_winner_olympic_icon_207790.png +0 -0
- package/shared/assets/server.svg +0 -41
- package/shared/fonts/circularstd-black.otf +0 -0
- package/shared/fonts/notoemoji-bold.ttf +0 -0
- package/shared/fonts/notosans-black.ttf +0 -0
- package/shared/fonts/notosans-jp-black.ttf +0 -0
- package/shared/fonts/notosans-kr-black.ttf +0 -0
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { join, extname } from "path";
|
|
2
|
-
import { readdirSync, lstatSync } from "node:fs";
|
|
3
|
-
/**
|
|
4
|
-
* @param dir - the directory to read (from the root directory)
|
|
5
|
-
* @param skipDirectories The directories/sub-directories to skip
|
|
6
|
-
* @param allowedExtensions extension of the files to read
|
|
7
|
-
* @example
|
|
8
|
-
* const { reacursiveReadDir } = require('skyhelper-utils');
|
|
9
|
-
*
|
|
10
|
-
* const files = recursiveReadDir('src/commands');
|
|
11
|
-
* const commands = [];
|
|
12
|
-
* files.forEach((file) => {
|
|
13
|
-
* const command = require(file);
|
|
14
|
-
* commands.push(command.data.name, command);
|
|
15
|
-
* });
|
|
16
|
-
*/
|
|
17
|
-
export const recursiveReadDir = (dir, skipDirectories = [], allowedExtensions = [".js", ".ts"]) => {
|
|
18
|
-
const filePaths = [];
|
|
19
|
-
const readCommands = (direct) => {
|
|
20
|
-
const files = readdirSync(join(process.cwd(), direct));
|
|
21
|
-
files.forEach((file) => {
|
|
22
|
-
const stat = lstatSync(join(process.cwd(), direct, file));
|
|
23
|
-
if (stat.isDirectory() && !skipDirectories.includes(file)) {
|
|
24
|
-
readCommands(join(direct, file));
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
const extension = extname(file);
|
|
28
|
-
if (!allowedExtensions.includes(extension))
|
|
29
|
-
return;
|
|
30
|
-
const filePath = join(process.cwd(), direct, file);
|
|
31
|
-
filePaths.push(filePath);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
readCommands(dir);
|
|
36
|
-
return filePaths;
|
|
37
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/** Original code credit to discord.js */
|
|
2
|
-
/**
|
|
3
|
-
* Resolves a ColorResolvable into a color number.
|
|
4
|
-
* @param color Color to resolve
|
|
5
|
-
* @returns A color
|
|
6
|
-
*/
|
|
7
|
-
export function resolveColor(color) {
|
|
8
|
-
let resolvedColor;
|
|
9
|
-
if (typeof color === "string") {
|
|
10
|
-
if (color === "Random")
|
|
11
|
-
return Math.floor(Math.random() * (0xffffff + 1));
|
|
12
|
-
if (color === "Default")
|
|
13
|
-
return 0;
|
|
14
|
-
if (/^#?[\da-f]{6}$/i.test(color))
|
|
15
|
-
return parseInt(color.replace("#", ""), 16);
|
|
16
|
-
resolvedColor = Colors[color];
|
|
17
|
-
}
|
|
18
|
-
else if (Array.isArray(color)) {
|
|
19
|
-
resolvedColor = (color[0] << 16) + (color[1] << 8) + color[2];
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
resolvedColor = color;
|
|
23
|
-
}
|
|
24
|
-
if (!Number.isInteger(resolvedColor)) {
|
|
25
|
-
throw new Error("Not a number");
|
|
26
|
-
}
|
|
27
|
-
if (resolvedColor < 0 || resolvedColor > 0xffffff) {
|
|
28
|
-
throw new Error("Not in color range");
|
|
29
|
-
}
|
|
30
|
-
return resolvedColor;
|
|
31
|
-
}
|
|
32
|
-
const Colors = {
|
|
33
|
-
Default: 0x000000,
|
|
34
|
-
White: 0xffffff,
|
|
35
|
-
Aqua: 0x1abc9c,
|
|
36
|
-
Green: 0x57f287,
|
|
37
|
-
Blue: 0x3498db,
|
|
38
|
-
Yellow: 0xfee75c,
|
|
39
|
-
Purple: 0x9b59b6,
|
|
40
|
-
LuminousVividPink: 0xe91e63,
|
|
41
|
-
Fuchsia: 0xeb459e,
|
|
42
|
-
Gold: 0xf1c40f,
|
|
43
|
-
Orange: 0xe67e22,
|
|
44
|
-
Red: 0xed4245,
|
|
45
|
-
Grey: 0x95a5a6,
|
|
46
|
-
Navy: 0x34495e,
|
|
47
|
-
DarkAqua: 0x11806a,
|
|
48
|
-
DarkGreen: 0x1f8b4c,
|
|
49
|
-
DarkBlue: 0x206694,
|
|
50
|
-
DarkPurple: 0x71368a,
|
|
51
|
-
DarkVividPink: 0xad1457,
|
|
52
|
-
DarkGold: 0xc27c0e,
|
|
53
|
-
DarkOrange: 0xa84300,
|
|
54
|
-
DarkRed: 0x992d22,
|
|
55
|
-
DarkGrey: 0x979c9f,
|
|
56
|
-
DarkerGrey: 0x7f8c8d,
|
|
57
|
-
LightGrey: 0xbcc0c0,
|
|
58
|
-
DarkNavy: 0x2c3e50,
|
|
59
|
-
Blurple: 0x5865f2,
|
|
60
|
-
Greyple: 0x99aab5,
|
|
61
|
-
DarkButNotBlack: 0x2c2f33,
|
|
62
|
-
NotQuiteBlack: 0x23272a,
|
|
63
|
-
};
|
package/shared/assets/Point.png
DELETED
|
Binary file
|
package/shared/assets/Win.png
DELETED
|
Binary file
|
|
Binary file
|
package/shared/assets/server.svg
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
-
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
-
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
|
5
|
-
<style type="text/css">
|
|
6
|
-
.st0{fill:#FFFFFF;}
|
|
7
|
-
</style>
|
|
8
|
-
<g>
|
|
9
|
-
<g>
|
|
10
|
-
<g>
|
|
11
|
-
<path class="st0" d="M266.7,298.7h170.7c5.9,0,10.7-4.8,10.7-10.7s-4.8-10.7-10.7-10.7H266.7c-5.9,0-10.7,4.8-10.7,10.7
|
|
12
|
-
S260.8,298.7,266.7,298.7z"/>
|
|
13
|
-
<path class="st0" d="M512,202.7V160c0-10.3-3.1-19.8-8.1-28c-0.1-0.3-0.1-0.6-0.3-0.8l-66-106C427.8,9.4,410.9,0,392.3,0H119.7
|
|
14
|
-
c-18.6,0-35.5,9.4-45.3,25.2l-66,106c-0.1,0.2-0.1,0.4-0.3,0.7C3.1,140.1,0,149.7,0,160v42.7c0,17.5,8.6,32.9,21.7,42.7
|
|
15
|
-
C8.6,255.1,0,270.5,0,288v42.7c0,17.5,8.6,32.9,21.7,42.7C8.6,383.1,0,398.5,0,416v42.7C0,488.1,23.9,512,53.3,512h139.9
|
|
16
|
-
c5.9,0,10.7-4.8,10.7-10.7s-4.8-10.7-10.7-10.7H53.3c-17.6,0-32-14.4-32-32V416c0-17.7,14.4-32,32-32h178.4
|
|
17
|
-
c5.9,0,10.7-4.8,10.7-10.7s-4.8-10.7-10.7-10.7H53.3c-17.6,0-32-14.4-32-32V288c0-17.7,14.4-32,32-32h405.3c17.6,0,32,14.4,32,32
|
|
18
|
-
v42.7c0,4.7-1.2,9.4-3.4,14c-2.6,5.3-0.4,11.7,4.9,14.3c5.3,2.6,11.7,0.4,14.3-4.9c3.7-7.5,5.5-15.3,5.5-23.3V288
|
|
19
|
-
c0-17.5-8.6-32.9-21.7-42.7C503.4,235.6,512,220.2,512,202.7z M92.5,36.4c5.9-9.5,16-15.1,27.2-15.1h272.6
|
|
20
|
-
c11.1,0,21.3,5.7,27.2,15.1l44,70.7c-1.6-0.2-3.2-0.5-4.8-0.5H53.3c-1.6,0-3.2,0.3-4.8,0.5L92.5,36.4z M490.7,202.7
|
|
21
|
-
c0,17.6-14.4,32-32,32H53.3c-17.6,0-32-14.4-32-32V160c0-17.7,14.4-32,32-32h405.3c17.6,0,32,14.3,32,32L490.7,202.7L490.7,202.7
|
|
22
|
-
z"/>
|
|
23
|
-
<path class="st0" d="M42.7,437.3c0,17.6,14.4,32,32,32s32-14.4,32-32s-14.4-32-32-32S42.7,419.7,42.7,437.3z M85.3,437.3
|
|
24
|
-
c0,5.9-4.8,10.7-10.7,10.7S64,443.2,64,437.3s4.8-10.7,10.7-10.7S85.3,431.4,85.3,437.3z"/>
|
|
25
|
-
<path class="st0" d="M437.3,362.7c-1.9,0-3.9,0.1-5.8,0.3C413.8,336.3,383.9,320,352,320c-49.7,0-90.6,37.9-95.5,86.3
|
|
26
|
-
c-24.6,4.7-43.2,26.4-43.2,52.4c0,29.4,23.9,53.3,53.3,53.3h170.7c41.2,0,74.7-33.5,74.7-74.7S478.5,362.7,437.3,362.7z
|
|
27
|
-
M437.3,490.7H266.7c-17.6,0-32-14.4-32-32s14.4-32,32-32c5.9,0,10.7-4.8,10.7-10.7c0-41.2,33.5-74.7,74.7-74.7
|
|
28
|
-
c26.7,0,51.5,14.7,64.8,38.4c2.2,3.9,6.6,6,11.2,5.3c3.1-0.5,6.1-1,9.3-1c29.4,0,53.3,23.9,53.3,53.3S466.7,490.7,437.3,490.7z"
|
|
29
|
-
/>
|
|
30
|
-
<path class="st0" d="M437.3,149.3H266.7c-5.9,0-10.7,4.8-10.7,10.7s4.8,10.7,10.7,10.7h170.7c5.9,0,10.7-4.8,10.7-10.7
|
|
31
|
-
S443.2,149.3,437.3,149.3z"/>
|
|
32
|
-
<path class="st0" d="M437.3,192H266.7c-5.9,0-10.7,4.8-10.7,10.7s4.8,10.7,10.7,10.7h170.7c5.9,0,10.7-4.8,10.7-10.7
|
|
33
|
-
S443.2,192,437.3,192z"/>
|
|
34
|
-
<path class="st0" d="M74.7,149.3c-17.6,0-32,14.3-32,32s14.4,32,32,32s32-14.4,32-32C106.7,163.7,92.3,149.3,74.7,149.3z
|
|
35
|
-
M74.7,192c-5.9,0-10.7-4.8-10.7-10.7s4.8-10.7,10.7-10.7s10.7,4.8,10.7,10.7S80.6,192,74.7,192z"/>
|
|
36
|
-
<path class="st0" d="M42.7,309.3c0,17.6,14.4,32,32,32s32-14.4,32-32s-14.4-32-32-32S42.7,291.7,42.7,309.3z M85.3,309.3
|
|
37
|
-
c0,5.9-4.8,10.7-10.7,10.7S64,315.2,64,309.3s4.8-10.7,10.7-10.7S85.3,303.4,85.3,309.3z"/>
|
|
38
|
-
</g>
|
|
39
|
-
</g>
|
|
40
|
-
</g>
|
|
41
|
-
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|