@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,65 +1,14 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.easterEggs = exports.sharedFuses = void 0;
40
- exports.checkNodeVersion = checkNodeVersion;
41
- exports.moduleInstalled = moduleInstalled;
42
- exports.initialStartupLogs = initialStartupLogs;
43
- exports.timer = timer;
44
- exports.emojiTitle = emojiTitle;
45
- exports.runAsync = runAsync;
46
- exports.timedAwait = timedAwait;
47
- exports.dateString = dateString;
48
- exports.asyncReplace = asyncReplace;
49
- exports.getLongestLength = getLongestLength;
50
- exports.ordinalNumber = ordinalNumber;
51
- exports.trimEmojis = trimEmojis;
52
- const fs = __importStar(require("fs"));
53
- const ansis_1 = __importDefault(require("ansis"));
54
- const api = __importStar(require("../api/index"));
1
+ import * as fs from "fs";
2
+ import ansis from "ansis";
3
+ import * as api from "../api/index.js";
55
4
  /**## sharedFuses `utility variable`
56
5
  * All shared fuses from Open Discord. Please use `opendiscord.sharedFuses` instead!
57
6
  */
58
- exports.sharedFuses = new api.ODSharedFuseManager();
7
+ export const sharedFuses = new api.ODSharedFuseManager();
59
8
  /**## checkNodeVersion `utility function`
60
9
  * Check if the node.js version is v20 or higher.
61
10
  */
62
- function checkNodeVersion(project) {
11
+ export function checkNodeVersion(project) {
63
12
  const nodev = process.versions.node.split(".");
64
13
  if (Number(nodev[0]) < 20) {
65
14
  const title = (project == "openticket") ? "OPEN TICKET" : "OPEN MODERATION";
@@ -71,9 +20,9 @@ function checkNodeVersion(project) {
71
20
  * Use this function to check if an npm package is installed or not!
72
21
  * @example utilities.moduleInstalled("discord.js") //check if discord.js is installed
73
22
  */
74
- function moduleInstalled(id, throwError) {
23
+ export function moduleInstalled(id, throwError) {
75
24
  try {
76
- require.resolve(id);
25
+ import.meta.resolve(id);
77
26
  return true;
78
27
  }
79
28
  catch {
@@ -86,7 +35,7 @@ function moduleInstalled(id, throwError) {
86
35
  * Use this function to check if an npm package is installed or not!
87
36
  * @example utilities.moduleInstalled("discord.js") //check if discord.js is installed
88
37
  */
89
- function initialStartupLogs(opendiscord, project) {
38
+ export function initialStartupLogs(opendiscord, project) {
90
39
  const title = (project == "openticket") ? "OPEN TICKET" : "OPEN MODERATION";
91
40
  console.log("\n--------------------------- " + title + " STARTUP ---------------------------");
92
41
  opendiscord.log("Logging system activated!", "system");
@@ -109,7 +58,7 @@ function initialStartupLogs(opendiscord, project) {
109
58
  * Use this to wait for a certain amount of milliseconds. This only works when using `await`
110
59
  * @example await utilities.timer(1000) //wait 1sec
111
60
  */
112
- async function timer(ms) {
61
+ export async function timer(ms) {
113
62
  return new Promise((resolve) => {
114
63
  setTimeout(() => {
115
64
  resolve();
@@ -120,9 +69,9 @@ async function timer(ms) {
120
69
  * Use this function to create a title with an emoji before/after the text. The style & divider are set in `opendiscord.sharedFuses`
121
70
  * @example utilities.emojiTitle("📎","Links") //create a title with an emoji based on the bot emoji style
122
71
  */
123
- function emojiTitle(emoji, text) {
124
- const style = exports.sharedFuses.getFuse("emojiTitleStyle");
125
- const divider = exports.sharedFuses.getFuse("emojiTitleDivider");
72
+ export function emojiTitle(emoji, text) {
73
+ const style = sharedFuses.getFuse("emojiTitleStyle");
74
+ const divider = sharedFuses.getFuse("emojiTitleDivider");
126
75
  if (style == "disabled")
127
76
  return text;
128
77
  else if (style == "before")
@@ -137,13 +86,13 @@ function emojiTitle(emoji, text) {
137
86
  /**## runAsync `utility function`
138
87
  * Use this function to run a snippet of code asyncronous without creating a separate function for it!
139
88
  */
140
- async function runAsync(func) {
89
+ export async function runAsync(func) {
141
90
  func();
142
91
  }
143
92
  /**## timedAwait `utility function`
144
93
  * Use this function to await a promise but reject after the certain timeout has been reached.
145
94
  */
146
- function timedAwait(promise, timeout, onError) {
95
+ export function timedAwait(promise, timeout, onError) {
147
96
  let allowResolve = true;
148
97
  return new Promise(async (resolve, reject) => {
149
98
  //set timeout & stop if it is before the promise resolved
@@ -166,13 +115,13 @@ function timedAwait(promise, timeout, onError) {
166
115
  /**## dateString `utility function`
167
116
  * Use this function to create a short date string in the following format: `DD/MM/YYYY HH:MM:SS`
168
117
  */
169
- function dateString(date) {
118
+ export function dateString(date) {
170
119
  return `${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
171
120
  }
172
121
  /**## asyncReplace `utility function`
173
122
  * Same as `string.replace(search, value)` but with async compatibility
174
123
  */
175
- async function asyncReplace(text, regex, func) {
124
+ export async function asyncReplace(text, regex, func) {
176
125
  const promises = [];
177
126
  text.replace(regex, (match, ...args) => {
178
127
  promises.push(func(match, ...args));
@@ -188,13 +137,13 @@ async function asyncReplace(text, regex, func) {
188
137
  /**## getLongestLength `utility function`
189
138
  * Get the length of the longest string in the array.
190
139
  */
191
- function getLongestLength(texts) {
192
- return Math.max(...texts.map((t) => ansis_1.default.strip(t).length));
140
+ export function getLongestLength(texts) {
141
+ return Math.max(...texts.map((t) => ansis.strip(t).length));
193
142
  }
194
143
  /**## ordinalNumber `utility function`
195
144
  * Get a human readable ordinal number (e.g. 1st, 2nd, 3rd, 4th, ...) from a Javascript number.
196
145
  */
197
- function ordinalNumber(num) {
146
+ export function ordinalNumber(num) {
198
147
  const i = Math.abs(Math.round(num));
199
148
  const cent = i % 100;
200
149
  if (cent >= 10 && cent <= 20)
@@ -211,13 +160,13 @@ function ordinalNumber(num) {
211
160
  /**## trimEmojis `utility function`
212
161
  * Trim/remove all emoji's from a Javascript string.
213
162
  */
214
- function trimEmojis(text) {
163
+ export function trimEmojis(text) {
215
164
  return text.replace(/(\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?(?:\u200D\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?)*)/gu, "");
216
165
  }
217
166
  /**## easterEggs `utility object`
218
167
  * Object containing data for Open Ticket easter eggs.
219
168
  */
220
- exports.easterEggs = {
169
+ export const easterEggs = {
221
170
  /* THANK YOU TO ALL OUR CONTRIBUTORS!!! */
222
171
  creator: "779742674932072469", //DJj123dj
223
172
  translators: [
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@open-discord-bots/framework",
3
3
  "author": "DJj123dj",
4
- "version": "0.2.12",
4
+ "version": "0.2.14",
5
5
  "description": "The core framework of the popular open-source discord bots: Open Ticket & Open Moderation.",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
+ "type": "module",
8
9
  "scripts": {
9
10
  "build": "node ./tools/cleanup.js && tsc -p ./tsconfig.json"
10
11
  },
package/src/api/index.ts CHANGED
@@ -1,29 +1,29 @@
1
1
  //MAIN MODULE
2
- export * from "./main"
2
+ export * from "./main.js"
3
3
 
4
4
  //BASE MODULES
5
- export * from "./modules/base"
6
- export * from "./modules/event"
7
- export * from "./modules/config"
8
- export * from "./modules/database"
9
- export * from "./modules/language"
10
- export * from "./modules/flag"
11
- export * from "./modules/console"
12
- export * from "./modules/fuse"
13
- export * from "./modules/plugin"
14
- export * from "./modules/checker"
15
- export * from "./modules/client"
16
- export * from "./modules/worker"
17
- export * from "./modules/builder"
18
- export * from "./modules/responder"
19
- export * from "./modules/action"
20
- export * from "./modules/permission"
21
- export * from "./modules/helpmenu"
22
- export * from "./modules/session"
23
- export * from "./modules/statistic"
24
- export * from "./modules/code"
25
- export * from "./modules/cooldown"
26
- export * from "./modules/post"
27
- export * from "./modules/verifybar"
28
- export * from "./modules/progressbar"
29
- export * from "./modules/startscreen"
5
+ export * from "./modules/base.js"
6
+ export * from "./modules/event.js"
7
+ export * from "./modules/config.js"
8
+ export * from "./modules/database.js"
9
+ export * from "./modules/language.js"
10
+ export * from "./modules/flag.js"
11
+ export * from "./modules/console.js"
12
+ export * from "./modules/fuse.js"
13
+ export * from "./modules/plugin.js"
14
+ export * from "./modules/checker.js"
15
+ export * from "./modules/client.js"
16
+ export * from "./modules/worker.js"
17
+ export * from "./modules/builder.js"
18
+ export * from "./modules/responder.js"
19
+ export * from "./modules/action.js"
20
+ export * from "./modules/permission.js"
21
+ export * from "./modules/helpmenu.js"
22
+ export * from "./modules/session.js"
23
+ export * from "./modules/statistic.js"
24
+ export * from "./modules/code.js"
25
+ export * from "./modules/cooldown.js"
26
+ export * from "./modules/post.js"
27
+ export * from "./modules/verifybar.js"
28
+ export * from "./modules/progressbar.js"
29
+ export * from "./modules/startscreen.js"
package/src/api/main.ts CHANGED
@@ -1,28 +1,28 @@
1
1
  //BASE MODULES
2
- import { ODEnvHelper, ODProjectType, ODVersion, ODVersionManager } from "./modules/base"
3
- import { ODConsoleManager, ODConsoleMessage, ODConsoleMessageParam, ODConsoleMessageTypes, ODDebugFileManager, ODDebugger, ODError, ODLiveStatusManager } from "./modules/console"
4
- import { ODCheckerManager } from "./modules/checker"
5
- import { ODEventManager } from "./modules/event"
6
- import { ODPluginManager } from "./modules/plugin"
7
- import { ODFlagManager } from "./modules/flag"
8
- import { ODProgressBarManager } from "./modules/progressbar"
9
- import { ODConfigManager } from "./modules/config"
10
- import { ODDatabaseManager } from "./modules/database"
11
- import { ODSessionManager } from "./modules/session"
12
- import { ODLanguageManager } from "./modules/language"
13
- import { ODBuilderManager } from "./modules/builder"
14
- import { ODResponderManager } from "./modules/responder"
15
- import { ODActionManager } from "./modules/action"
16
- import { ODVerifyBarManager } from "./modules/verifybar"
17
- import { ODPermissionManager } from "./modules/permission"
18
- import { ODCooldownManager } from "./modules/cooldown"
19
- import { ODHelpMenuManager } from "./modules/helpmenu"
20
- import { ODStatisticManager } from "./modules/statistic"
21
- import { ODCodeManager } from "./modules/code"
22
- import { ODPostManager } from "./modules/post"
23
- import { ODClientManager } from "./modules/client"
24
- import { ODSharedFuseManager } from "./modules/fuse"
25
- import { ODStartScreenManager } from "./modules/startscreen"
2
+ import { ODEnvHelper, ODProjectType, ODVersion, ODVersionManager } from "./modules/base.js"
3
+ import { ODConsoleManager, ODConsoleMessage, ODConsoleMessageParam, ODConsoleMessageTypes, ODDebugFileManager, ODDebugger, ODError, ODLiveStatusManager } from "./modules/console.js"
4
+ import { ODCheckerManager } from "./modules/checker.js"
5
+ import { ODEventManager } from "./modules/event.js"
6
+ import { ODPluginManager } from "./modules/plugin.js"
7
+ import { ODFlagManager } from "./modules/flag.js"
8
+ import { ODProgressBarManager } from "./modules/progressbar.js"
9
+ import { ODConfigManager } from "./modules/config.js"
10
+ import { ODDatabaseManager } from "./modules/database.js"
11
+ import { ODSessionManager } from "./modules/session.js"
12
+ import { ODLanguageManager } from "./modules/language.js"
13
+ import { ODBuilderManager } from "./modules/builder.js"
14
+ import { ODResponderManager } from "./modules/responder.js"
15
+ import { ODActionManager } from "./modules/action.js"
16
+ import { ODVerifyBarManager } from "./modules/verifybar.js"
17
+ import { ODPermissionManager } from "./modules/permission.js"
18
+ import { ODCooldownManager } from "./modules/cooldown.js"
19
+ import { ODHelpMenuManager } from "./modules/helpmenu.js"
20
+ import { ODStatisticManager } from "./modules/statistic.js"
21
+ import { ODCodeManager } from "./modules/code.js"
22
+ import { ODPostManager } from "./modules/post.js"
23
+ import { ODClientManager } from "./modules/client.js"
24
+ import { ODSharedFuseManager } from "./modules/fuse.js"
25
+ import { ODStartScreenManager } from "./modules/startscreen.js"
26
26
 
27
27
  /**## ODMainManagers `interface`
28
28
  * The global properties for the main class of the bot.
@@ -142,7 +142,7 @@ export class ODMain implements ODMainManagers {
142
142
  constructor(managers:ODMainManagers,project:ODProjectType){
143
143
  this.project = project
144
144
  this.versions = managers.versions
145
- this.versions.add(ODVersion.fromString("opendiscord:api","v0.2.12"))
145
+ this.versions.add(ODVersion.fromString("opendiscord:api","v0.2.14"))
146
146
  this.versions.add(ODVersion.fromString("opendiscord:livestatus","v2.0.0"))
147
147
 
148
148
  this.debugfile = managers.debugfile
@@ -1,9 +1,9 @@
1
1
  ///////////////////////////////////////
2
2
  //ACTION MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODManager, ODValidId, ODSystemError, ODManagerData, ODNoGeneric } from "./base"
5
- import { ODWorkerManager, ODWorkerCallback, ODWorker } from "./worker"
6
- import { ODDebugger } from "./console"
4
+ import { ODId, ODManager, ODValidId, ODSystemError, ODManagerData, ODNoGeneric } from "./base.js"
5
+ import { ODWorkerManager, ODWorkerCallback, ODWorker } from "./worker.js"
6
+ import { ODDebugger } from "./console.js"
7
7
 
8
8
  /**## ODActionImplementation `class`
9
9
  * This is an Open Discord action implementation.
@@ -2,8 +2,8 @@
2
2
  //BASE MODULE
3
3
  ///////////////////////////////////////
4
4
  import * as fs from "fs"
5
- import { ODDebugger } from "./console"
6
- import type { ODMain } from "../main"
5
+ import { ODDebugger } from "./console.js"
6
+ import type { ODMain } from "../main.js"
7
7
 
8
8
  /**## ODPromiseVoid `type`
9
9
  * This is a simple type to represent a callback return value that could be a promise or not.
@@ -1,10 +1,10 @@
1
1
  ///////////////////////////////////////
2
2
  //BUILDER MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODValidButtonColor, ODValidId, ODSystemError, ODInterfaceWithPartialProperty, ODManagerWithSafety, ODManagerData, ODNoGeneric } from "./base"
4
+ import { ODId, ODValidButtonColor, ODValidId, ODSystemError, ODInterfaceWithPartialProperty, ODManagerWithSafety, ODManagerData, ODNoGeneric } from "./base.js"
5
5
  import * as discord from "discord.js"
6
- import { ODWorkerManager, ODWorkerCallback, ODWorker } from "./worker"
7
- import { ODDebugger } from "./console"
6
+ import { ODWorkerManager, ODWorkerCallback, ODWorker } from "./worker.js"
7
+ import { ODDebugger } from "./console.js"
8
8
 
9
9
  /**## ODBuilderImplementation `class`
10
10
  * This is an Open Discord builder implementation.
@@ -1,10 +1,10 @@
1
1
  ///////////////////////////////////////
2
2
  //CONFIG CHECKER MODULE
3
3
  ///////////////////////////////////////
4
- import { ODDiscordIdType, ODId, ODManager, ODManagerData, ODNoGeneric, ODValidId, ODValidJsonType } from "./base"
5
- import { ODConfig } from "./config"
6
- import { ODLanguageManager } from "./language"
7
- import { ODDebugger } from "./console"
4
+ import { ODDiscordIdType, ODId, ODManager, ODManagerData, ODNoGeneric, ODValidId, ODValidJsonType } from "./base.js"
5
+ import { ODConfig } from "./config.js"
6
+ import { ODLanguageManager } from "./language.js"
7
+ import { ODDebugger } from "./console.js"
8
8
  import ansis from "ansis"
9
9
 
10
10
  /**## ODCheckerResult `interface`
@@ -1,12 +1,12 @@
1
1
  ///////////////////////////////////////
2
2
  //DISCORD CLIENT MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODManager, ODManagerData, ODNoGeneric, ODSystemError, ODValidId } from "./base"
4
+ import { ODId, ODManager, ODManagerData, ODNoGeneric, ODSystemError, ODValidId } from "./base.js"
5
5
  import * as discord from "discord.js"
6
6
  import {REST} from "@discordjs/rest"
7
- import { ODWarningConsoleMessage, ODDebugger } from "./console"
8
- import { ODMessageBuildResult, ODMessageBuildSentResult } from "./builder"
9
- import { ODManualProgressBar } from "./progressbar"
7
+ import { ODWarningConsoleMessage, ODDebugger } from "./console.js"
8
+ import { ODMessageBuildResult, ODMessageBuildSentResult } from "./builder.js"
9
+ import { ODManualProgressBar } from "./progressbar.js"
10
10
 
11
11
  /**## ODClientIntents `type`
12
12
  * A list of intents required when inviting the bot.
@@ -1,8 +1,8 @@
1
1
  ///////////////////////////////////////
2
2
  //CODE MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODManager, ODManagerData, ODNoGeneric, ODValidId } from "./base"
5
- import { ODDebugger } from "./console"
4
+ import { ODId, ODManager, ODManagerData, ODNoGeneric, ODValidId } from "./base.js"
5
+ import { ODDebugger } from "./console.js"
6
6
 
7
7
 
8
8
  /**## ODCode `class`
@@ -1,10 +1,10 @@
1
1
  ///////////////////////////////////////
2
2
  //COMPONENTS MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODValidId, ODSystemError, ODManagerData, ODNoGeneric, ODManager } from "./base"
4
+ import { ODId, ODValidId, ODSystemError, ODManagerData, ODNoGeneric, ODManager } from "./base.js"
5
5
  import * as discord from "discord.js"
6
- import { ODWorkerManager, ODWorkerCallback, ODWorker } from "./worker"
7
- import { ODDebugger } from "./console"
6
+ import { ODWorkerManager, ODWorkerCallback, ODWorker } from "./worker.js"
7
+ import { ODDebugger } from "./console.js"
8
8
 
9
9
  /**## ODComponentFactoryInstance `class`
10
10
  * An Open Discord component factory instance.
@@ -1,9 +1,9 @@
1
1
  ///////////////////////////////////////
2
2
  //CONFIG MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODManager, ODManagerData, ODNoGeneric, ODPromiseVoid, ODSystemError, ODValidId, ODValidJsonType } from "./base"
4
+ import { ODId, ODManager, ODManagerData, ODNoGeneric, ODPromiseVoid, ODSystemError, ODValidId, ODValidJsonType } from "./base.js"
5
5
  import nodepath from "path"
6
- import { ODDebugger } from "./console"
6
+ import { ODDebugger } from "./console.js"
7
7
  import fs from "fs"
8
8
  import * as fjs from "formatted-json-stringify"
9
9
 
@@ -1,8 +1,8 @@
1
1
  ///////////////////////////////////////
2
2
  //CONSOLE MODULE
3
3
  ///////////////////////////////////////
4
- import { ODHTTPGetRequest, ODVersion, ODSystemError, ODPluginError, ODManager, ODManagerData, ODValidId, ODNoGeneric } from "./base"
5
- import { ODMain } from "../main"
4
+ import { ODHTTPGetRequest, ODVersion, ODSystemError, ODPluginError, ODManager, ODManagerData, ODValidId, ODNoGeneric } from "./base.js"
5
+ import { ODMain } from "../main.js"
6
6
  import nodepath from "path"
7
7
  import fs from "fs"
8
8
  import ansis from "ansis"
@@ -1,8 +1,8 @@
1
1
  ///////////////////////////////////////
2
2
  //COOLDOWN MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODValidId, ODManager, ODSystemError, ODManagerData, ODNoGeneric } from "./base"
5
- import { ODDebugger } from "./console"
4
+ import { ODId, ODValidId, ODManager, ODSystemError, ODManagerData, ODNoGeneric } from "./base.js"
5
+ import { ODDebugger } from "./console.js"
6
6
 
7
7
  /**## ODCooldownManagerIdConstraint `type`
8
8
  * The constraint/layout for id mappings/interfaces of the `ODCooldownManager` class.
@@ -1,10 +1,10 @@
1
1
  ///////////////////////////////////////
2
2
  //DATABASE MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODManager, ODManagerData, ODNoGeneric, ODOptionalPromise, ODPromiseVoid, ODSystemError, ODValidId, ODValidJsonType } from "./base"
4
+ import { ODId, ODManager, ODManagerData, ODNoGeneric, ODOptionalPromise, ODPromiseVoid, ODSystemError, ODValidId, ODValidJsonType } from "./base.js"
5
5
  import fs from "fs"
6
6
  import nodepath from "path"
7
- import { ODDebugger } from "./console"
7
+ import { ODDebugger } from "./console.js"
8
8
  import * as fjs from "formatted-json-stringify"
9
9
 
10
10
  /**## ODDatabaseManagerIdConstraint `type`
@@ -1,8 +1,8 @@
1
1
  ///////////////////////////////////////
2
2
  //EVENT MODULE
3
3
  ///////////////////////////////////////
4
- import { ODManagerData, ODManager, ODValidId, ODPromiseVoid, ODNoGeneric, ODSystemError } from "./base"
5
- import { ODWarningConsoleMessage, ODDebugger } from "./console"
4
+ import { ODManagerData, ODManager, ODValidId, ODPromiseVoid, ODNoGeneric, ODSystemError } from "./base.js"
5
+ import { ODWarningConsoleMessage, ODDebugger } from "./console.js"
6
6
 
7
7
  /**## ODEventCallback `type`
8
8
  * The base callback function for events.
@@ -1,8 +1,8 @@
1
1
  ///////////////////////////////////////
2
2
  //FLAG MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODValidId, ODManager, ODManagerData, ODNoGeneric } from "./base"
5
- import { ODDebugger } from "./console"
4
+ import { ODId, ODValidId, ODManager, ODManagerData, ODNoGeneric } from "./base.js"
5
+ import { ODDebugger } from "./console.js"
6
6
 
7
7
  /**## ODFlag `class`
8
8
  * This is an Open Discord flag.
@@ -1,8 +1,8 @@
1
1
  ///////////////////////////////////////
2
2
  //HELP MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODManager, ODManagerData, ODNoGeneric, ODSystemError, ODValidId } from "./base"
5
- import { ODDebugger } from "./console"
4
+ import { ODId, ODManager, ODManagerData, ODNoGeneric, ODSystemError, ODValidId } from "./base.js"
5
+ import { ODDebugger } from "./console.js"
6
6
 
7
7
  /**## ODHelpMenuComponentRenderer `type`
8
8
  * This is the callback of the help menu component renderer. It also contains information about how & where it is rendered.
@@ -1,9 +1,9 @@
1
1
  ///////////////////////////////////////
2
2
  //LANGUAGE MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODManager, ODManagerData, ODNoGeneric, ODPromiseVoid, ODSystemError, ODValidId } from "./base"
4
+ import { ODId, ODManager, ODManagerData, ODNoGeneric, ODPromiseVoid, ODSystemError, ODValidId } from "./base.js"
5
5
  import nodepath from "path"
6
- import { ODDebugger } from "./console"
6
+ import { ODDebugger } from "./console.js"
7
7
  import fs from "fs"
8
8
 
9
9
  /**## ODLanguageMetadata `interface`
@@ -1,10 +1,10 @@
1
1
  ///////////////////////////////////////
2
2
  //PERMISSION MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODValidId, ODManager, ODSystemError, ODManagerData, ODNoGeneric } from "./base"
4
+ import { ODId, ODValidId, ODManager, ODSystemError, ODManagerData, ODNoGeneric } from "./base.js"
5
5
  import * as discord from "discord.js"
6
- import { ODDebugger } from "./console"
7
- import { ODClientManager } from "./client"
6
+ import { ODDebugger } from "./console.js"
7
+ import { ODClientManager } from "./client.js"
8
8
 
9
9
  /**## ODPermissionType `type`
10
10
  * All available permission types/levels. Can be used in the `ODPermission` class.
@@ -1,8 +1,8 @@
1
1
  ///////////////////////////////////////
2
2
  //PLUGIN MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODManager, ODManagerData, ODNoGeneric, ODValidId, ODVersion } from "./base"
5
- import { ODDebugger } from "./console"
4
+ import { ODId, ODManager, ODManagerData, ODNoGeneric, ODValidId, ODVersion } from "./base.js"
5
+ import { ODDebugger } from "./console.js"
6
6
  import nodepath from "path"
7
7
 
8
8
  /**## ODUnknownCrashedPlugin `interface`
@@ -180,7 +180,7 @@ export class ODPlugin extends ODManagerData {
180
180
  if ((this.enabled && !this.crashed) || force){
181
181
  try{
182
182
  //import relative plugin directory path (works on windows & unix based systems)
183
- const pluginPath = nodepath.join("../../../../plugins/",this.getStartFile()).replaceAll("\\","/")
183
+ const pluginPath = nodepath.join(process.cwd(),"./dist/plugins/",this.getStartFile()).replaceAll("\\","/")
184
184
  await import(pluginPath)
185
185
  debug.console.log("Plugin \""+this.id.value+"\" loaded successfully!","plugin")
186
186
  this.executed = true
@@ -203,7 +203,7 @@ export class ODPlugin extends ODManagerData {
203
203
  /**Check if a npm dependency exists. */
204
204
  #checkDependency(id:string){
205
205
  try{
206
- require.resolve(id)
206
+ import.meta.resolve(id)
207
207
  return true
208
208
  }catch{
209
209
  return false
@@ -1,9 +1,9 @@
1
1
  ///////////////////////////////////////
2
2
  //POST MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODManager, ODManagerData, ODNoGeneric, ODValidId } from "./base"
5
- import { ODMessageBuildResult, ODMessageBuildSentResult } from "./builder"
6
- import { ODDebugger } from "./console"
4
+ import { ODId, ODManager, ODManagerData, ODNoGeneric, ODValidId } from "./base.js"
5
+ import { ODMessageBuildResult, ODMessageBuildSentResult } from "./builder.js"
6
+ import { ODDebugger } from "./console.js"
7
7
  import * as discord from "discord.js"
8
8
 
9
9
  /**## ODPostManagerIdConstraint `type`
@@ -1,8 +1,8 @@
1
1
  ///////////////////////////////////////
2
2
  //PROGRESS BAR MODULE
3
3
  ///////////////////////////////////////
4
- import { ODSystemError, ODManager, ODManagerData, ODValidId, ODNoGeneric } from "./base"
5
- import { ODDebugger, ODValidConsoleColor } from "./console"
4
+ import { ODSystemError, ODManager, ODManagerData, ODValidId, ODNoGeneric } from "./base.js"
5
+ import { ODDebugger, ODValidConsoleColor } from "./console.js"
6
6
  import readline from "readline"
7
7
  import ansis from "ansis"
8
8
 
@@ -1,12 +1,12 @@
1
1
  ///////////////////////////////////////
2
2
  //RESPONDER MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODManager, ODValidId, ODSystemError, ODManagerData, ODNoGeneric } from "./base"
4
+ import { ODId, ODManager, ODValidId, ODSystemError, ODManagerData, ODNoGeneric } from "./base.js"
5
5
  import * as discord from "discord.js"
6
- import { ODWorkerManager, ODWorkerCallback, ODWorker } from "./worker"
7
- import { ODDebugger } from "./console"
8
- import { ODClientManager, ODContextMenu, ODSlashCommand, ODTextCommand, ODTextCommandInteractionOption } from "./client"
9
- import { ODDropdownData, ODMessageBuildResult, ODMessageBuildSentResult, ODModalBuildResult } from "./builder"
6
+ import { ODWorkerManager, ODWorkerCallback, ODWorker } from "./worker.js"
7
+ import { ODDebugger } from "./console.js"
8
+ import { ODClientManager, ODContextMenu, ODSlashCommand, ODTextCommand, ODTextCommandInteractionOption } from "./client.js"
9
+ import { ODDropdownData, ODMessageBuildResult, ODMessageBuildSentResult, ODModalBuildResult } from "./builder.js"
10
10
 
11
11
  /**## ODResponderImplementation `class`
12
12
  * This is an Open Discord responder implementation.
@@ -1,8 +1,8 @@
1
1
  ///////////////////////////////////////
2
2
  //SESSION MODULE
3
3
  ///////////////////////////////////////
4
- import { ODId, ODManager, ODManagerData, ODNoGeneric, ODValidId } from "./base"
5
- import { ODDebugger } from "./console"
4
+ import { ODId, ODManager, ODManagerData, ODNoGeneric, ODValidId } from "./base.js"
5
+ import { ODDebugger } from "./console.js"
6
6
  import * as crypto from "crypto"
7
7
 
8
8
  /**## ODSessionManagerIdConstraint `type`