@elara-services/packages 6.0.0 → 6.0.2
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/package.json +1 -1
- package/dist/src/interfaces/discord.d.ts +2 -2
- package/dist/src/lib/AES.js +19 -8
- package/dist/src/lib/discord.d.ts +3 -3
- package/dist/src/lib/discord.js +84 -39
- package/dist/src/lib/languages.d.ts +114 -4
- package/dist/src/lib/languages.js +120 -118
- package/dist/src/lib/minesweeper.js +24 -10
- package/dist/src/lib/misc.js +5 -4
- package/dist/src/lib/random.js +1960 -251
- package/dist/src/lib/tasks.js +5 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/AES.html +6 -7
- package/docs/classes/Minesweeper.html +12 -13
- package/docs/classes/Tasks.html +4 -5
- package/docs/functions/fetch.html +2 -3
- package/docs/functions/randomWeight.html +2 -3
- package/docs/functions/randomWords.html +2 -3
- package/docs/index.html +1 -2
- package/docs/interfaces/ButtonOptions.html +11 -12
- package/docs/interfaces/ModalOptions.html +7 -8
- package/docs/interfaces/RandomWord.html +10 -11
- package/docs/interfaces/SelectOptions.html +13 -14
- package/docs/interfaces/Slash.html +9 -10
- package/docs/interfaces/SlashOptions.html +15 -16
- package/docs/interfaces/TaskCreate.html +5 -6
- package/docs/interfaces/TextInputOptions.html +16 -17
- package/docs/modules.html +2 -4
- package/docs/types/ButtonNumberStyles.html +2 -3
- package/docs/types/ButtonStyles.html +2 -3
- package/docs/types/ChannelTypes.html +2 -3
- package/docs/types/Lang.html +3 -4
- package/docs/types/LangName.html +2 -3
- package/docs/variables/ButtonStyle.html +2 -3
- package/docs/variables/Duration.html +2 -3
- package/docs/variables/Interactions.html +2 -3
- package/docs/variables/Languages.html +294 -0
- package/docs/variables/SlashBuilder.html +16 -17
- package/package.json +1 -1
- package/docs/functions/find.html +0 -75
- package/docs/variables/langs.html +0 -279
@@ -1,123 +1,125 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.Languages = void 0;
|
4
4
|
const utils_1 = require("@elara-services/utils");
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
5
|
+
const langs = {
|
6
|
+
en: "English",
|
7
|
+
fr: "French",
|
8
|
+
es: "Spanish",
|
9
|
+
pt: "Portuguese",
|
10
|
+
tr: "Turkish",
|
11
|
+
ru: "Russian",
|
12
|
+
ar: "Arabic",
|
13
|
+
af: "Afrikaans",
|
14
|
+
sq: "Albanian",
|
15
|
+
am: "Amharic",
|
16
|
+
hy: "Armenian",
|
17
|
+
az: "Azerbaijani",
|
18
|
+
eu: "Basque",
|
19
|
+
be: "Belarusian",
|
20
|
+
bn: "Bengali",
|
21
|
+
bs: "Bosnian",
|
22
|
+
bg: "Bulgarian",
|
23
|
+
ca: "Catalan",
|
24
|
+
ceb: "Cebuano",
|
25
|
+
ny: "Chichewa",
|
26
|
+
zh: "Chinese (Simplified)",
|
27
|
+
"zh-tw": "Chinese (Traditional)",
|
28
|
+
co: "Corsican",
|
29
|
+
hr: "Croatian",
|
30
|
+
cs: "Czech",
|
31
|
+
da: "Danish",
|
32
|
+
nl: "Dutch",
|
33
|
+
eo: "Esperanto",
|
34
|
+
et: "Estonian",
|
35
|
+
tl: "Filipino",
|
36
|
+
fi: "Finnish",
|
37
|
+
fy: "Frisian",
|
38
|
+
gl: "Galician",
|
39
|
+
ka: "Georgian",
|
40
|
+
de: "German",
|
41
|
+
el: "Greek",
|
42
|
+
gu: "Gujarati",
|
43
|
+
ht: "Haitian Creole",
|
44
|
+
ha: "Hausa",
|
45
|
+
haw: "Hawaiian",
|
46
|
+
he: "Hebrew",
|
47
|
+
iw: "Hebrew",
|
48
|
+
hi: "Hindi",
|
49
|
+
hmn: "Hmong",
|
50
|
+
hu: "Hungarian",
|
51
|
+
is: "Icelandic",
|
52
|
+
ig: "Igbo",
|
53
|
+
id: "Indonesian",
|
54
|
+
ga: "Irish",
|
55
|
+
it: "Italian",
|
56
|
+
ja: "Japanese",
|
57
|
+
jw: "Javanese",
|
58
|
+
kn: "Kannada",
|
59
|
+
kk: "Kazakh",
|
60
|
+
km: "Khmer",
|
61
|
+
ko: "Korean",
|
62
|
+
ku: "Kurdish (Kurmanji)",
|
63
|
+
ky: "Kyrgyz",
|
64
|
+
lo: "Lao",
|
65
|
+
la: "Latin",
|
66
|
+
lv: "Latvian",
|
67
|
+
lt: "Lithuanian",
|
68
|
+
lb: "Luxembourgish",
|
69
|
+
mk: "Macedonian",
|
70
|
+
mg: "Malagasy",
|
71
|
+
ms: "Malay",
|
72
|
+
ml: "Malayalam",
|
73
|
+
mt: "Maltese",
|
74
|
+
mi: "Maori",
|
75
|
+
mr: "Marathi",
|
76
|
+
mn: "Mongolian",
|
77
|
+
my: "Myanmar (Burmese)",
|
78
|
+
ne: "Nepali",
|
79
|
+
no: "Norwegian",
|
80
|
+
ps: "Pashto",
|
81
|
+
fa: "Persian",
|
82
|
+
pl: "Polish",
|
83
|
+
pa: "Punjabi",
|
84
|
+
ro: "Romanian",
|
85
|
+
sm: "Samoan",
|
86
|
+
gd: "Scots Gaelic",
|
87
|
+
sr: "Serbian",
|
88
|
+
st: "Sesotho",
|
89
|
+
sn: "Shona",
|
90
|
+
sd: "Sindhi",
|
91
|
+
si: "Sinhala",
|
92
|
+
sk: "Slovak",
|
93
|
+
sl: "Slovenian",
|
94
|
+
so: "Somali",
|
95
|
+
su: "Sundanese",
|
96
|
+
sw: "Swahili",
|
97
|
+
sv: "Swedish",
|
98
|
+
tg: "Tajik",
|
99
|
+
ta: "Tamil",
|
100
|
+
te: "Telugu",
|
101
|
+
th: "Thai",
|
102
|
+
uk: "Ukrainian",
|
103
|
+
ur: "Urdu",
|
104
|
+
uz: "Uzbek",
|
105
|
+
vi: "Vietnamese",
|
106
|
+
cy: "Welsh",
|
107
|
+
xh: "Xhosa",
|
108
|
+
yi: "Yiddish",
|
109
|
+
yo: "Yoruba",
|
110
|
+
zu: "Zulu",
|
111
111
|
};
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
112
|
+
exports.Languages = {
|
113
|
+
langs,
|
114
|
+
find(name) {
|
115
|
+
for (const key of (0, utils_1.getKeys)(langs)) {
|
116
|
+
if (key === name) {
|
117
|
+
return key;
|
118
|
+
}
|
119
|
+
if (langs[key] === name) {
|
120
|
+
return key;
|
121
|
+
}
|
116
122
|
}
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
}
|
121
|
-
return null;
|
122
|
-
}
|
123
|
-
exports.find = find;
|
123
|
+
return null;
|
124
|
+
},
|
125
|
+
};
|
@@ -11,10 +11,16 @@ class Minesweeper {
|
|
11
11
|
this.types = {
|
12
12
|
mine: (_d = opts === null || opts === void 0 ? void 0 : opts.emote) !== null && _d !== void 0 ? _d : "bomb",
|
13
13
|
numbers: [
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
"zero",
|
15
|
+
"one",
|
16
|
+
"two",
|
17
|
+
"three",
|
18
|
+
"four",
|
19
|
+
"five",
|
20
|
+
"six",
|
21
|
+
"seven",
|
22
|
+
"eight",
|
23
|
+
],
|
18
24
|
};
|
19
25
|
}
|
20
26
|
generateEmptyMatrix() {
|
@@ -41,17 +47,25 @@ class Minesweeper {
|
|
41
47
|
}
|
42
48
|
let counter = 0;
|
43
49
|
const hasLeft = y > 0;
|
44
|
-
const hasRight = y <
|
50
|
+
const hasRight = y < this.columns - 1;
|
45
51
|
const hasTop = x > 0;
|
46
|
-
const hasBottom = x <
|
47
|
-
counter += +(hasTop &&
|
52
|
+
const hasBottom = x < this.rows - 1;
|
53
|
+
counter += +(hasTop &&
|
54
|
+
hasLeft &&
|
55
|
+
this.matrix[x - 1][y - 1] === this.types.mine);
|
48
56
|
counter += +(hasTop && this.matrix[x - 1][y] === this.types.mine);
|
49
|
-
counter += +(hasTop &&
|
57
|
+
counter += +(hasTop &&
|
58
|
+
hasRight &&
|
59
|
+
this.matrix[x - 1][y + 1] === this.types.mine);
|
50
60
|
counter += +(hasLeft && this.matrix[x][y - 1] === this.types.mine);
|
51
61
|
counter += +(hasRight && this.matrix[x][y + 1] === this.types.mine);
|
52
|
-
counter += +(hasBottom &&
|
62
|
+
counter += +(hasBottom &&
|
63
|
+
hasLeft &&
|
64
|
+
this.matrix[x + 1][y - 1] === this.types.mine);
|
53
65
|
counter += +(hasBottom && this.matrix[x + 1][y] === this.types.mine);
|
54
|
-
counter += +(hasBottom &&
|
66
|
+
counter += +(hasBottom &&
|
67
|
+
hasRight &&
|
68
|
+
this.matrix[x + 1][y + 1] === this.types.mine);
|
55
69
|
return this.types.numbers[counter];
|
56
70
|
}
|
57
71
|
start() {
|
package/dist/src/lib/misc.js
CHANGED
@@ -42,16 +42,17 @@ function fetch(url, key = "", body = undefined, postRequest = false, returnRaw =
|
|
42
42
|
}
|
43
43
|
const headers = {
|
44
44
|
"User-Agent": `Services v${Math.floor(Math.random() * 999999)}`,
|
45
|
-
authorization: ""
|
45
|
+
authorization: "",
|
46
46
|
};
|
47
47
|
if (key !== "" && key) {
|
48
|
-
headers[
|
48
|
+
headers["authorization"] = key;
|
49
49
|
}
|
50
50
|
else {
|
51
51
|
// @ts-expect-error
|
52
|
-
delete headers[
|
52
|
+
delete headers["authorization"];
|
53
53
|
}
|
54
|
-
const res = yield client
|
54
|
+
const res = yield client
|
55
|
+
.fetch(url, postRequest ? "POST" : "GET")
|
55
56
|
.header(headers)
|
56
57
|
.body(body, "json")
|
57
58
|
.send()
|