@elara-services/packages 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/package.json +1 -1
  2. package/dist/src/interfaces/discord.d.ts +2 -2
  3. package/dist/src/lib/AES.js +19 -8
  4. package/dist/src/lib/discord.js +84 -39
  5. package/dist/src/lib/languages.d.ts +114 -4
  6. package/dist/src/lib/languages.js +120 -118
  7. package/dist/src/lib/minesweeper.js +24 -10
  8. package/dist/src/lib/misc.js +5 -4
  9. package/dist/src/lib/random.js +1960 -251
  10. package/dist/src/lib/tasks.js +5 -1
  11. package/docs/assets/search.js +1 -1
  12. package/docs/classes/AES.html +6 -7
  13. package/docs/classes/Minesweeper.html +12 -13
  14. package/docs/classes/Tasks.html +4 -5
  15. package/docs/functions/fetch.html +2 -3
  16. package/docs/functions/randomWeight.html +2 -3
  17. package/docs/functions/randomWords.html +2 -3
  18. package/docs/index.html +1 -2
  19. package/docs/interfaces/ButtonOptions.html +11 -12
  20. package/docs/interfaces/ModalOptions.html +7 -8
  21. package/docs/interfaces/RandomWord.html +10 -11
  22. package/docs/interfaces/SelectOptions.html +13 -14
  23. package/docs/interfaces/Slash.html +9 -10
  24. package/docs/interfaces/SlashOptions.html +15 -16
  25. package/docs/interfaces/TaskCreate.html +5 -6
  26. package/docs/interfaces/TextInputOptions.html +16 -17
  27. package/docs/modules.html +2 -4
  28. package/docs/types/ButtonNumberStyles.html +2 -3
  29. package/docs/types/ButtonStyles.html +2 -3
  30. package/docs/types/ChannelTypes.html +2 -3
  31. package/docs/types/Lang.html +3 -4
  32. package/docs/types/LangName.html +2 -3
  33. package/docs/variables/ButtonStyle.html +2 -3
  34. package/docs/variables/Duration.html +2 -3
  35. package/docs/variables/Interactions.html +2 -3
  36. package/docs/variables/Languages.html +294 -0
  37. package/docs/variables/SlashBuilder.html +2 -3
  38. package/package.json +1 -1
  39. package/docs/functions/find.html +0 -75
  40. 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.find = exports.langs = void 0;
3
+ exports.Languages = void 0;
4
4
  const utils_1 = require("@elara-services/utils");
5
- exports.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'
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
- function find(name) {
113
- for (const key of (0, utils_1.getKeys)(exports.langs)) {
114
- if (key === name) {
115
- return key;
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
- if (exports.langs[key] === name) {
118
- return key;
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
- 'zero', 'one', 'two',
15
- 'three', 'four', 'five',
16
- 'six', 'seven', 'eight'
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 < (this.columns - 1);
50
+ const hasRight = y < this.columns - 1;
45
51
  const hasTop = x > 0;
46
- const hasBottom = x < (this.rows - 1);
47
- counter += +(hasTop && hasLeft && this.matrix[x - 1][y - 1] === this.types.mine);
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 && hasRight && this.matrix[x - 1][y + 1] === this.types.mine);
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 && hasLeft && this.matrix[x + 1][y - 1] === this.types.mine);
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 && hasRight && this.matrix[x + 1][y + 1] === this.types.mine);
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() {
@@ -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['authorization'] = key;
48
+ headers["authorization"] = key;
49
49
  }
50
50
  else {
51
51
  // @ts-expect-error
52
- delete headers['authorization'];
52
+ delete headers["authorization"];
53
53
  }
54
- const res = yield client.fetch(url, postRequest ? "POST" : "GET")
54
+ const res = yield client
55
+ .fetch(url, postRequest ? "POST" : "GET")
55
56
  .header(headers)
56
57
  .body(body, "json")
57
58
  .send()