@open-discord-bots/framework 0.2.12 → 0.2.14

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 (107) hide show
  1. package/dist/api/index.d.ts +26 -26
  2. package/dist/api/index.js +26 -42
  3. package/dist/api/main.d.ts +24 -24
  4. package/dist/api/main.js +7 -11
  5. package/dist/api/modules/action.d.ts +3 -3
  6. package/dist/api/modules/action.js +8 -14
  7. package/dist/api/modules/base.d.ts +2 -2
  8. package/dist/api/modules/base.js +14 -63
  9. package/dist/api/modules/builder.d.ts +3 -3
  10. package/dist/api/modules/builder.js +61 -122
  11. package/dist/api/modules/checker.d.ts +4 -4
  12. package/dist/api/modules/checker.js +55 -87
  13. package/dist/api/modules/client.d.ts +4 -4
  14. package/dist/api/modules/client.js +71 -118
  15. package/dist/api/modules/code.d.ts +2 -2
  16. package/dist/api/modules/code.js +3 -8
  17. package/dist/api/modules/config.d.ts +2 -2
  18. package/dist/api/modules/config.js +21 -63
  19. package/dist/api/modules/console.d.ts +2 -2
  20. package/dist/api/modules/console.js +45 -67
  21. package/dist/api/modules/cooldown.d.ts +2 -2
  22. package/dist/api/modules/cooldown.js +13 -23
  23. package/dist/api/modules/database.d.ts +2 -2
  24. package/dist/api/modules/database.js +19 -29
  25. package/dist/api/modules/event.d.ts +2 -2
  26. package/dist/api/modules/event.js +6 -11
  27. package/dist/api/modules/flag.d.ts +2 -2
  28. package/dist/api/modules/flag.js +3 -8
  29. package/dist/api/modules/fuse.js +2 -7
  30. package/dist/api/modules/helpmenu.d.ts +2 -2
  31. package/dist/api/modules/helpmenu.js +8 -16
  32. package/dist/api/modules/language.d.ts +2 -2
  33. package/dist/api/modules/language.js +12 -21
  34. package/dist/api/modules/permission.d.ts +3 -3
  35. package/dist/api/modules/permission.js +9 -47
  36. package/dist/api/modules/plugin.d.ts +2 -2
  37. package/dist/api/modules/plugin.js +10 -19
  38. package/dist/api/modules/post.d.ts +3 -3
  39. package/dist/api/modules/post.js +3 -8
  40. package/dist/api/modules/progressbar.d.ts +2 -2
  41. package/dist/api/modules/progressbar.js +13 -26
  42. package/dist/api/modules/responder.d.ts +5 -5
  43. package/dist/api/modules/responder.js +66 -125
  44. package/dist/api/modules/session.d.ts +2 -2
  45. package/dist/api/modules/session.js +4 -42
  46. package/dist/api/modules/startscreen.d.ts +4 -4
  47. package/dist/api/modules/startscreen.js +28 -44
  48. package/dist/api/modules/statistic.d.ts +3 -3
  49. package/dist/api/modules/statistic.js +11 -20
  50. package/dist/api/modules/verifybar.d.ts +5 -5
  51. package/dist/api/modules/verifybar.js +6 -11
  52. package/dist/api/modules/worker.d.ts +1 -1
  53. package/dist/api/modules/worker.js +6 -11
  54. package/dist/cli/editConfig.d.ts +2 -2
  55. package/dist/cli/editConfig.js +189 -229
  56. package/dist/cli/index.d.ts +2 -2
  57. package/dist/cli/index.js +37 -62
  58. package/dist/index.d.ts +4 -4
  59. package/dist/index.js +6 -13
  60. package/dist/startup/compilation.d.ts +1 -1
  61. package/dist/startup/compilation.js +36 -43
  62. package/dist/startup/dump.d.ts +1 -1
  63. package/dist/startup/dump.js +4 -41
  64. package/dist/startup/errorHandling.d.ts +1 -1
  65. package/dist/startup/errorHandling.js +2 -38
  66. package/dist/startup/pluginLauncher.d.ts +1 -1
  67. package/dist/startup/pluginLauncher.js +9 -49
  68. package/dist/utilities/index.d.ts +1 -1
  69. package/dist/utilities/index.js +21 -72
  70. package/package.json +2 -1
  71. package/src/api/index.ts +26 -26
  72. package/src/api/main.ts +25 -25
  73. package/src/api/modules/action.ts +3 -3
  74. package/src/api/modules/base.ts +2 -2
  75. package/src/api/modules/builder.ts +3 -3
  76. package/src/api/modules/checker.ts +4 -4
  77. package/src/api/modules/client.ts +4 -4
  78. package/src/api/modules/code.ts +2 -2
  79. package/src/api/modules/component.txt +3 -3
  80. package/src/api/modules/config.ts +2 -2
  81. package/src/api/modules/console.ts +2 -2
  82. package/src/api/modules/cooldown.ts +2 -2
  83. package/src/api/modules/database.ts +2 -2
  84. package/src/api/modules/event.ts +2 -2
  85. package/src/api/modules/flag.ts +2 -2
  86. package/src/api/modules/helpmenu.ts +2 -2
  87. package/src/api/modules/language.ts +2 -2
  88. package/src/api/modules/permission.ts +3 -3
  89. package/src/api/modules/plugin.ts +4 -4
  90. package/src/api/modules/post.ts +3 -3
  91. package/src/api/modules/progressbar.ts +2 -2
  92. package/src/api/modules/responder.ts +5 -5
  93. package/src/api/modules/session.ts +2 -2
  94. package/src/api/modules/startscreen.ts +4 -4
  95. package/src/api/modules/statistic.ts +3 -3
  96. package/src/api/modules/verifybar.ts +5 -5
  97. package/src/api/modules/worker.ts +1 -1
  98. package/src/cli/editConfig.ts +3 -3
  99. package/src/cli/index.ts +3 -3
  100. package/src/index.ts +5 -5
  101. package/src/startup/compilation.ts +2 -2
  102. package/src/startup/dump.ts +2 -2
  103. package/src/startup/errorHandling.ts +2 -2
  104. package/src/startup/pluginLauncher.ts +2 -2
  105. package/src/utilities/index.ts +2 -2
  106. package/tools/cleanup.js +1 -1
  107. package/tsconfig.json +1 -1
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ODIncrementalTimeoutCooldown = exports.ODTimeoutCooldown = exports.ODIncrementalCounterCooldown = exports.ODCounterCooldown = exports.ODCooldown = exports.ODCooldownData = exports.ODCooldownManager = void 0;
4
1
  ///////////////////////////////////////
5
2
  //COOLDOWN MODULE
6
3
  ///////////////////////////////////////
7
- const base_1 = require("./base");
4
+ import { ODManager, ODSystemError, ODManagerData } from "./base.js";
8
5
  /**## ODCooldownManager `class`
9
6
  * This is an Open Discord cooldown manager.
10
7
  *
@@ -12,7 +9,7 @@ const base_1 = require("./base");
12
9
  *
13
10
  * There are many types of cooldowns available, but you can also create your own!
14
11
  */
15
- class ODCooldownManager extends base_1.ODManager {
12
+ export class ODCooldownManager extends ODManager {
16
13
  constructor(debug) {
17
14
  super(debug, "cooldown");
18
15
  }
@@ -32,13 +29,12 @@ class ODCooldownManager extends base_1.ODManager {
32
29
  return super.exists(id);
33
30
  }
34
31
  }
35
- exports.ODCooldownManager = ODCooldownManager;
36
32
  /**## ODCooldownData `class`
37
33
  * This is Open Discord cooldown data.
38
34
  *
39
35
  * It contains the instance of an active cooldown (e.g. for a user). It is handled by the cooldown itself.
40
36
  */
41
- class ODCooldownData extends base_1.ODManagerData {
37
+ export class ODCooldownData extends ODManagerData {
42
38
  /**Is this cooldown active? */
43
39
  active;
44
40
  /**Additional data of this cooldown instance. (different for each cooldown type) */
@@ -49,7 +45,6 @@ class ODCooldownData extends base_1.ODManagerData {
49
45
  this.data = data;
50
46
  }
51
47
  }
52
- exports.ODCooldownData = ODCooldownData;
53
48
  /**## ODCooldown `class`
54
49
  * This is an Open Discord cooldown.
55
50
  *
@@ -58,8 +53,8 @@ exports.ODCooldownData = ODCooldownData;
58
53
  *
59
54
  * There are also premade cooldowns available in the bot!
60
55
  */
61
- class ODCooldown extends base_1.ODManagerData {
62
- data = new base_1.ODManager();
56
+ export class ODCooldown extends ODManagerData {
57
+ data = new ODManager();
63
58
  /**Is this cooldown already initialized? */
64
59
  ready = false;
65
60
  constructor(id) {
@@ -67,29 +62,28 @@ class ODCooldown extends base_1.ODManagerData {
67
62
  }
68
63
  /**Check this id and start cooldown when it exeeds the limit! Returns `true` when on cooldown! */
69
64
  use(id) {
70
- throw new base_1.ODSystemError("Tried to use an unimplemented ODCooldown!");
65
+ throw new ODSystemError("Tried to use an unimplemented ODCooldown!");
71
66
  }
72
67
  /**Check this id without starting or updating the cooldown. Returns `true` when on cooldown! */
73
68
  check(id) {
74
- throw new base_1.ODSystemError("Tried to use an unimplemented ODCooldown!");
69
+ throw new ODSystemError("Tried to use an unimplemented ODCooldown!");
75
70
  }
76
71
  /**Remove the cooldown for an id when available.*/
77
72
  delete(id) {
78
- throw new base_1.ODSystemError("Tried to use an unimplemented ODCooldown!");
73
+ throw new ODSystemError("Tried to use an unimplemented ODCooldown!");
79
74
  }
80
75
  /**Initialize the internal systems of this cooldown. */
81
76
  async init() {
82
- throw new base_1.ODSystemError("Tried to use an unimplemented ODCooldown!");
77
+ throw new ODSystemError("Tried to use an unimplemented ODCooldown!");
83
78
  }
84
79
  }
85
- exports.ODCooldown = ODCooldown;
86
80
  /**## ODCounterCooldown `class`
87
81
  * This is an Open Discord counter cooldown.
88
82
  *
89
83
  * It is is a cooldown based on a counter. When the number exceeds the limit, the cooldown is activated.
90
84
  * The number will automatically be decreased with a set amount & interval.
91
85
  */
92
- class ODCounterCooldown extends ODCooldown {
86
+ export class ODCounterCooldown extends ODCooldown {
93
87
  /**The cooldown will activate when exceeding this limit. */
94
88
  activeLimit;
95
89
  /**The cooldown will deactivate when below this limit. */
@@ -161,14 +155,13 @@ class ODCounterCooldown extends ODCooldown {
161
155
  this.ready = true;
162
156
  }
163
157
  }
164
- exports.ODCounterCooldown = ODCounterCooldown;
165
158
  /**## ODIncrementalCounterCooldown `class`
166
159
  * This is an Open Discord incremental counter cooldown.
167
160
  *
168
161
  * It is is a cooldown based on an incremental counter. It is exactly the same as the normal counter,
169
162
  * with the only difference being that it still increments when the limit is already exeeded.
170
163
  */
171
- class ODIncrementalCounterCooldown extends ODCooldown {
164
+ export class ODIncrementalCounterCooldown extends ODCooldown {
172
165
  /**The cooldown will activate when exceeding this limit. */
173
166
  activeLimit;
174
167
  /**The cooldown will deactivate when below this limit. */
@@ -241,14 +234,13 @@ class ODIncrementalCounterCooldown extends ODCooldown {
241
234
  this.ready = true;
242
235
  }
243
236
  }
244
- exports.ODIncrementalCounterCooldown = ODIncrementalCounterCooldown;
245
237
  /**## ODTimeoutCooldown `class`
246
238
  * This is an Open Discord timeout cooldown.
247
239
  *
248
240
  * It is a cooldown based on a timer. When triggered/updated, the cooldown is activated for the set amount of time.
249
241
  * After the timer has timed out, the cooldown will be deleted.
250
242
  */
251
- class ODTimeoutCooldown extends ODCooldown {
243
+ export class ODTimeoutCooldown extends ODCooldown {
252
244
  /**The amount of milliseconds before the cooldown times-out */
253
245
  timeoutMs;
254
246
  constructor(id, timeoutMs) {
@@ -301,14 +293,13 @@ class ODTimeoutCooldown extends ODCooldown {
301
293
  this.ready = true;
302
294
  }
303
295
  }
304
- exports.ODTimeoutCooldown = ODTimeoutCooldown;
305
296
  /**## ODIncrementalTimeoutCooldown `class`
306
297
  * This is an Open Discord incremental timeout cooldown.
307
298
  *
308
299
  * It is is a cooldown based on an incremental timer. It is exactly the same as the normal timer,
309
300
  * with the only difference being that it adds additional time when triggered/updated while the cooldown is already active.
310
301
  */
311
- class ODIncrementalTimeoutCooldown extends ODCooldown {
302
+ export class ODIncrementalTimeoutCooldown extends ODCooldown {
312
303
  /**The amount of milliseconds before the cooldown times-out */
313
304
  timeoutMs;
314
305
  /**The amount of milliseconds to add when triggered/updated while the cooldown is already active. */
@@ -365,4 +356,3 @@ class ODIncrementalTimeoutCooldown extends ODCooldown {
365
356
  this.ready = true;
366
357
  }
367
358
  }
368
- exports.ODIncrementalTimeoutCooldown = ODIncrementalTimeoutCooldown;
@@ -1,5 +1,5 @@
1
- import { ODManager, ODManagerData, ODNoGeneric, ODOptionalPromise, ODPromiseVoid, ODValidId, ODValidJsonType } from "./base";
2
- import { ODDebugger } from "./console";
1
+ import { ODManager, ODManagerData, ODNoGeneric, ODOptionalPromise, ODPromiseVoid, ODValidId, ODValidJsonType } from "./base.js";
2
+ import { ODDebugger } from "./console.js";
3
3
  import * as fjs from "formatted-json-stringify";
4
4
  /**## ODDatabaseManagerIdConstraint `type`
5
5
  * The constraint/layout for id mappings/interfaces of the `ODDatabaseManager` class.
@@ -1,15 +1,9 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ODFormattedJsonDatabase = exports.ODJsonDatabase = exports.ODDatabase = exports.ODDatabaseManager = void 0;
7
1
  ///////////////////////////////////////
8
2
  //DATABASE MODULE
9
3
  ///////////////////////////////////////
10
- const base_1 = require("./base");
11
- const fs_1 = __importDefault(require("fs"));
12
- const path_1 = __importDefault(require("path"));
4
+ import { ODManager, ODManagerData, ODSystemError } from "./base.js";
5
+ import fs from "fs";
6
+ import nodepath from "path";
13
7
  /**## ODDatabaseManager `class`
14
8
  * This is an Open Discord database manager.
15
9
  *
@@ -17,7 +11,7 @@ const path_1 = __importDefault(require("path"));
17
11
  *
18
12
  * You can use this class to get/add a database (`ODDatabase`) in your plugin!
19
13
  */
20
- class ODDatabaseManager extends base_1.ODManager {
14
+ export class ODDatabaseManager extends ODManager {
21
15
  constructor(debug) {
22
16
  super(debug, "database");
23
17
  }
@@ -28,7 +22,7 @@ class ODDatabaseManager extends base_1.ODManager {
28
22
  await database.init();
29
23
  }
30
24
  catch (err) {
31
- process.emit("uncaughtException", new base_1.ODSystemError(err));
25
+ process.emit("uncaughtException", new ODSystemError(err));
32
26
  }
33
27
  }
34
28
  }
@@ -42,14 +36,13 @@ class ODDatabaseManager extends base_1.ODManager {
42
36
  return super.exists(id);
43
37
  }
44
38
  }
45
- exports.ODDatabaseManager = ODDatabaseManager;
46
39
  /**## ODDatabase `class`
47
40
  * This is an Open Discord database template.
48
41
  * This class doesn't do anything at all, it just gives a template & basic methods for a database. Use `ODJsonDatabase` instead!
49
42
  *
50
43
  * You can use this class if you want to create your own database implementation (e.g. `mongodb`, `mysql`,...)!
51
44
  */
52
- class ODDatabase extends base_1.ODManagerData {
45
+ export class ODDatabase extends ODManagerData {
53
46
  /**The name of the file with extension. */
54
47
  file = "";
55
48
  /**The path to the file relative to the main directory. */
@@ -78,7 +71,6 @@ class ODDatabase extends base_1.ODManagerData {
78
71
  return [];
79
72
  }
80
73
  }
81
- exports.ODDatabase = ODDatabase;
82
74
  /**## ODJsonDatabase `class`
83
75
  * This is an Open Discord JSON database.
84
76
  * It stores data in a `json` file as a large `Array` using the `category`, `key`, `value` strategy.
@@ -86,11 +78,11 @@ exports.ODDatabase = ODDatabase;
86
78
  *
87
79
  * You can use this class if you want to add your own database or to use an existing one!
88
80
  */
89
- class ODJsonDatabase extends ODDatabase {
81
+ export class ODJsonDatabase extends ODDatabase {
90
82
  constructor(id, file, customPath) {
91
83
  super(id);
92
84
  this.file = (file.endsWith(".json")) ? file : file + ".json";
93
- this.path = customPath ? path_1.default.join("./", customPath, this.file) : path_1.default.join("./database/", this.file);
85
+ this.path = customPath ? nodepath.join("./", customPath, this.file) : nodepath.join("./database/", this.file);
94
86
  }
95
87
  /**Init the database. */
96
88
  init() {
@@ -150,27 +142,26 @@ class ODJsonDatabase extends ODDatabase {
150
142
  #system = {
151
143
  /**Read parsed data from the json file */
152
144
  getData: () => {
153
- if (fs_1.default.existsSync(this.path)) {
145
+ if (fs.existsSync(this.path)) {
154
146
  try {
155
- return JSON.parse(fs_1.default.readFileSync(this.path).toString());
147
+ return JSON.parse(fs.readFileSync(this.path).toString());
156
148
  }
157
149
  catch (err) {
158
150
  process.emit("uncaughtException", err);
159
- throw new base_1.ODSystemError("Unable to read database " + this.path + "! getData() read error. (see error above)");
151
+ throw new ODSystemError("Unable to read database " + this.path + "! getData() read error. (see error above)");
160
152
  }
161
153
  }
162
154
  else {
163
- fs_1.default.writeFileSync(this.path, "[]");
155
+ fs.writeFileSync(this.path, "[]");
164
156
  return [];
165
157
  }
166
158
  },
167
159
  /**Write parsed data to the json file */
168
160
  setData: (data) => {
169
- fs_1.default.writeFileSync(this.path, JSON.stringify(data, null, "\t"));
161
+ fs.writeFileSync(this.path, JSON.stringify(data, null, "\t"));
170
162
  }
171
163
  };
172
164
  }
173
- exports.ODJsonDatabase = ODJsonDatabase;
174
165
  /**## ODFormattedJsonDatabase `class`
175
166
  * This is an Open Discord Formatted JSON database.
176
167
  * It stores data in a `json` file as a large `Array` using the `category`, `key`, `value` strategy.
@@ -179,13 +170,13 @@ exports.ODJsonDatabase = ODJsonDatabase;
179
170
  * This one is exactly the same as `ODJsonDatabase`, but it has a formatter from the `formatted-json-stringify` package.
180
171
  * This can help you organise it a little bit better!
181
172
  */
182
- class ODFormattedJsonDatabase extends ODDatabase {
173
+ export class ODFormattedJsonDatabase extends ODDatabase {
183
174
  /**The formatter to use on the database array */
184
175
  formatter;
185
176
  constructor(id, file, formatter, customPath) {
186
177
  super(id);
187
178
  this.file = (file.endsWith(".json")) ? file : file + ".json";
188
- this.path = customPath ? path_1.default.join("./", customPath, this.file) : path_1.default.join("./database/", this.file);
179
+ this.path = customPath ? nodepath.join("./", customPath, this.file) : nodepath.join("./database/", this.file);
189
180
  this.formatter = formatter;
190
181
  }
191
182
  /**Init the database. */
@@ -246,18 +237,17 @@ class ODFormattedJsonDatabase extends ODDatabase {
246
237
  #system = {
247
238
  /**Read parsed data from the json file */
248
239
  getData: () => {
249
- if (fs_1.default.existsSync(this.path)) {
250
- return JSON.parse(fs_1.default.readFileSync(this.path).toString());
240
+ if (fs.existsSync(this.path)) {
241
+ return JSON.parse(fs.readFileSync(this.path).toString());
251
242
  }
252
243
  else {
253
- fs_1.default.writeFileSync(this.path, "[]");
244
+ fs.writeFileSync(this.path, "[]");
254
245
  return [];
255
246
  }
256
247
  },
257
248
  /**Write parsed data to the json file */
258
249
  setData: (data) => {
259
- fs_1.default.writeFileSync(this.path, this.formatter.stringify(data));
250
+ fs.writeFileSync(this.path, this.formatter.stringify(data));
260
251
  }
261
252
  };
262
253
  }
263
- exports.ODFormattedJsonDatabase = ODFormattedJsonDatabase;
@@ -1,5 +1,5 @@
1
- import { ODManagerData, ODManager, ODValidId, ODPromiseVoid, ODNoGeneric } from "./base";
2
- import { ODDebugger } from "./console";
1
+ import { ODManagerData, ODManager, ODValidId, ODPromiseVoid, ODNoGeneric } from "./base.js";
2
+ import { ODDebugger } from "./console.js";
3
3
  /**## ODEventCallback `type`
4
4
  * The base callback function for events.
5
5
  */
@@ -1,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ODEventManager = exports.ODEvent = void 0;
4
1
  ///////////////////////////////////////
5
2
  //EVENT MODULE
6
3
  ///////////////////////////////////////
7
- const base_1 = require("./base");
8
- const console_1 = require("./console");
4
+ import { ODManagerData, ODManager, ODSystemError } from "./base.js";
5
+ import { ODWarningConsoleMessage } from "./console.js";
9
6
  /**## ODEvent `class`
10
7
  * This is an Open Discord event.
11
8
  *
12
9
  * This class is made to work with the `ODEventManager` to handle events.
13
10
  * The function of this specific class is to manage all listeners for a specifc event!
14
11
  */
15
- class ODEvent extends base_1.ODManagerData {
12
+ export class ODEvent extends ODManagerData {
16
13
  /**Alias to Open Discord debugger. */
17
14
  #debug;
18
15
  /**The list of permanent listeners. */
@@ -42,7 +39,7 @@ class ODEvent extends base_1.ODManagerData {
42
39
  this.listeners.push(callback);
43
40
  if (this.listeners.length > this.listenerLimit) {
44
41
  if (this.#debug)
45
- this.#debug.console.log(new console_1.ODWarningConsoleMessage("Possible event memory leak detected!", [
42
+ this.#debug.console.log(new ODWarningConsoleMessage("Possible event memory leak detected!", [
46
43
  { key: "event", value: this.id.value },
47
44
  { key: "listeners", value: this.listeners.length.toString() }
48
45
  ]));
@@ -65,12 +62,11 @@ class ODEvent extends base_1.ODManagerData {
65
62
  await listener(...params);
66
63
  }
67
64
  catch (err) {
68
- process.emit("uncaughtException", new base_1.ODSystemError(err));
65
+ process.emit("uncaughtException", new ODSystemError(err));
69
66
  }
70
67
  }
71
68
  }
72
69
  }
73
- exports.ODEvent = ODEvent;
74
70
  /**## ODEventManager `class`
75
71
  * This is an Open Discord event manager.
76
72
  *
@@ -79,7 +75,7 @@ exports.ODEvent = ODEvent;
79
75
  * It's not recommended to create this class yourself. Plugin events should be registered in their `plugin.json` file instead.
80
76
  * All events are available in the `opendiscord.events` global!
81
77
  */
82
- class ODEventManager extends base_1.ODManager {
78
+ export class ODEventManager extends ODManager {
83
79
  /**Reference to the Open Discord debugger */
84
80
  #debug;
85
81
  constructor(debug) {
@@ -103,4 +99,3 @@ class ODEventManager extends base_1.ODManager {
103
99
  return super.exists(id);
104
100
  }
105
101
  }
106
- exports.ODEventManager = ODEventManager;
@@ -1,5 +1,5 @@
1
- import { ODValidId, ODManager, ODManagerData, ODNoGeneric } from "./base";
2
- import { ODDebugger } from "./console";
1
+ import { ODValidId, ODManager, ODManagerData, ODNoGeneric } from "./base.js";
2
+ import { ODDebugger } from "./console.js";
3
3
  /**## ODFlag `class`
4
4
  * This is an Open Discord flag.
5
5
  *
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ODFlagManager = exports.ODFlag = void 0;
4
1
  ///////////////////////////////////////
5
2
  //FLAG MODULE
6
3
  ///////////////////////////////////////
7
- const base_1 = require("./base");
4
+ import { ODManager, ODManagerData } from "./base.js";
8
5
  /**## ODFlag `class`
9
6
  * This is an Open Discord flag.
10
7
  *
@@ -13,7 +10,7 @@ const base_1 = require("./base");
13
10
  *
14
11
  * Flags can also be enabled manually by plugins!
15
12
  */
16
- class ODFlag extends base_1.ODManagerData {
13
+ export class ODFlag extends ODManagerData {
17
14
  /**The method that has been used to set the value of this flag. (`null` when not set) */
18
15
  method = null;
19
16
  /**The name of this flag. Visible to the user. */
@@ -51,14 +48,13 @@ class ODFlag extends base_1.ODManagerData {
51
48
  }
52
49
  }
53
50
  }
54
- exports.ODFlag = ODFlag;
55
51
  /**## ODFlagManager `class`
56
52
  * This is an Open Discord flag manager.
57
53
  *
58
54
  * This class is responsible for managing & initiating all flags of the bot.
59
55
  * It also contains a shortcut for initiating all flags.
60
56
  */
61
- class ODFlagManager extends base_1.ODManager {
57
+ export class ODFlagManager extends ODManager {
62
58
  constructor(debug) {
63
59
  super(debug, "flag");
64
60
  }
@@ -78,4 +74,3 @@ class ODFlagManager extends base_1.ODManager {
78
74
  return super.exists(id);
79
75
  }
80
76
  }
81
- exports.ODFlagManager = ODFlagManager;
@@ -1,9 +1,6 @@
1
- "use strict";
2
1
  ///////////////////////////////////////
3
2
  //FUSE MODULE
4
3
  ///////////////////////////////////////
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ODSharedFuseManager = exports.ODFuseManager = void 0;
7
4
  /**## ODFuseManager `class`
8
5
  * This is an Open Discord fuse manager.
9
6
  *
@@ -12,7 +9,7 @@ exports.ODSharedFuseManager = exports.ODFuseManager = void 0;
12
9
  *
13
10
  * You can think of them like real fuses, they disable an entire branch of the bot!
14
11
  */
15
- class ODFuseManager {
12
+ export class ODFuseManager {
16
13
  /**A list of all the defaults */
17
14
  fuses;
18
15
  constructor(fuses) {
@@ -27,7 +24,6 @@ class ODFuseManager {
27
24
  return this.fuses[key];
28
25
  }
29
26
  }
30
- exports.ODFuseManager = ODFuseManager;
31
27
  /**## ODFuseManager `class`
32
28
  * This is an Open Discord fuse manager.
33
29
  *
@@ -36,7 +32,7 @@ exports.ODFuseManager = ODFuseManager;
36
32
  *
37
33
  * You can think of them like real fuses, they disable an entire branch of the bot!
38
34
  */
39
- class ODSharedFuseManager extends ODFuseManager {
35
+ export class ODSharedFuseManager extends ODFuseManager {
40
36
  constructor() {
41
37
  super({
42
38
  errorHandling: true,
@@ -120,4 +116,3 @@ class ODSharedFuseManager extends ODFuseManager {
120
116
  });
121
117
  }
122
118
  }
123
- exports.ODSharedFuseManager = ODSharedFuseManager;
@@ -1,5 +1,5 @@
1
- import { ODId, ODManager, ODManagerData, ODNoGeneric, ODValidId } from "./base";
2
- import { ODDebugger } from "./console";
1
+ import { ODId, ODManager, ODManagerData, ODNoGeneric, ODValidId } from "./base.js";
2
+ import { ODDebugger } from "./console.js";
3
3
  /**## ODHelpMenuComponentRenderer `type`
4
4
  * This is the callback of the help menu component renderer. It also contains information about how & where it is rendered.
5
5
  */
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ODHelpMenuManager = exports.ODHelpMenuCategory = exports.ODHelpMenuCommandComponent = exports.ODHelpMenuTextComponent = exports.ODHelpMenuComponent = void 0;
4
1
  ///////////////////////////////////////
5
2
  //HELP MODULE
6
3
  ///////////////////////////////////////
7
- const base_1 = require("./base");
4
+ import { ODId, ODManager, ODManagerData, ODSystemError } from "./base.js";
8
5
  /**## ODHelpMenuComponent `class`
9
6
  * This is an Open Discord help menu component.
10
7
  *
11
8
  * It can render something on the Open Discord help menu.
12
9
  */
13
- class ODHelpMenuComponent extends base_1.ODManagerData {
10
+ export class ODHelpMenuComponent extends ODManagerData {
14
11
  /**The priority of this component. The higher, the earlier it will appear in the help menu. */
15
12
  priority;
16
13
  /**The render function for this component. */
@@ -21,26 +18,24 @@ class ODHelpMenuComponent extends base_1.ODManagerData {
21
18
  this.render = render;
22
19
  }
23
20
  }
24
- exports.ODHelpMenuComponent = ODHelpMenuComponent;
25
21
  /**## ODHelpMenuTextComponent `class`
26
22
  * This is an Open Discord help menu text component.
27
23
  *
28
24
  * It can render a static piece of text on the Open Discord help menu.
29
25
  */
30
- class ODHelpMenuTextComponent extends ODHelpMenuComponent {
26
+ export class ODHelpMenuTextComponent extends ODHelpMenuComponent {
31
27
  constructor(id, priority, text) {
32
28
  super(id, priority, () => {
33
29
  return text;
34
30
  });
35
31
  }
36
32
  }
37
- exports.ODHelpMenuTextComponent = ODHelpMenuTextComponent;
38
33
  /**## ODHelpMenuCommandComponent `class`
39
34
  * This is an Open Discord help menu command component.
40
35
  *
41
36
  * It contains a useful helper to render a command in the Open Discord help menu.
42
37
  */
43
- class ODHelpMenuCommandComponent extends ODHelpMenuComponent {
38
+ export class ODHelpMenuCommandComponent extends ODHelpMenuComponent {
44
39
  constructor(id, priority, settings) {
45
40
  super(id, priority, (page, category, location, mode) => {
46
41
  if (mode == "slash" && settings.slashName) {
@@ -58,14 +53,13 @@ class ODHelpMenuCommandComponent extends ODHelpMenuComponent {
58
53
  return " " + options.map((opt) => (opt.optional) ? `[${opt.name}]` : `<${opt.name}>`).join(" ");
59
54
  }
60
55
  }
61
- exports.ODHelpMenuCommandComponent = ODHelpMenuCommandComponent;
62
56
  /**## ODHelpMenuCategory `class`
63
57
  * This is an Open Discord help menu category.
64
58
  *
65
59
  * Every category in the help menu is an embed field by default.
66
60
  * Try to limit the amount of components per category.
67
61
  */
68
- class ODHelpMenuCategory extends base_1.ODManager {
62
+ export class ODHelpMenuCategory extends ODManager {
69
63
  /**The id of this category. */
70
64
  id;
71
65
  /**The priority of this category. The higher, the earlier it will appear in the menu. */
@@ -76,7 +70,7 @@ class ODHelpMenuCategory extends base_1.ODManager {
76
70
  newPage;
77
71
  constructor(id, priority, name, newPage) {
78
72
  super();
79
- this.id = new base_1.ODId(id);
73
+ this.id = new ODId(id);
80
74
  this.priority = priority;
81
75
  this.name = name;
82
76
  this.newPage = newPage ?? false;
@@ -95,7 +89,7 @@ class ODHelpMenuCategory extends base_1.ODManager {
95
89
  result.push(await component.render(page, category, i, mode));
96
90
  }
97
91
  catch (err) {
98
- process.emit("uncaughtException", new base_1.ODSystemError(err));
92
+ process.emit("uncaughtException", new ODSystemError(err));
99
93
  }
100
94
  i++;
101
95
  }
@@ -112,7 +106,6 @@ class ODHelpMenuCategory extends base_1.ODManager {
112
106
  return super.exists(id);
113
107
  }
114
108
  }
115
- exports.ODHelpMenuCategory = ODHelpMenuCategory;
116
109
  /**## ODHelpMenuManager `class`
117
110
  * This is an Open Discord help menu manager.
118
111
  *
@@ -121,7 +114,7 @@ exports.ODHelpMenuCategory = ODHelpMenuCategory;
121
114
  *
122
115
  * Fewer Categories == More Clean Menu
123
116
  */
124
- class ODHelpMenuManager extends base_1.ODManager {
117
+ export class ODHelpMenuManager extends ODManager {
125
118
  /**Alias to Open Discord debugger. */
126
119
  #debug;
127
120
  /**The amount of categories per-page. */
@@ -182,4 +175,3 @@ class ODHelpMenuManager extends base_1.ODManager {
182
175
  return super.exists(id);
183
176
  }
184
177
  }
185
- exports.ODHelpMenuManager = ODHelpMenuManager;
@@ -1,5 +1,5 @@
1
- import { ODManager, ODManagerData, ODNoGeneric, ODPromiseVoid, ODValidId } from "./base";
2
- import { ODDebugger } from "./console";
1
+ import { ODManager, ODManagerData, ODNoGeneric, ODPromiseVoid, ODValidId } from "./base.js";
2
+ import { ODDebugger } from "./console.js";
3
3
  /**## ODLanguageMetadata `interface`
4
4
  * This interface contains all metadata available in the language files.
5
5
  */