@open-discord-bots/framework 2.0.0 → 2.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.
package/dist/api/main.js CHANGED
@@ -44,7 +44,7 @@ export class ODMain {
44
44
  constructor(managers, project) {
45
45
  this.project = project;
46
46
  this.versions = managers.versions;
47
- this.versions.add(ODVersion.fromString("opendiscord:api", "v2.0.0"));
47
+ this.versions.add(ODVersion.fromString("opendiscord:api", "v2.0.1"));
48
48
  this.versions.add(ODVersion.fromString("opendiscord:livestatus", "v2.0.0"));
49
49
  this.debugfile = managers.debugfile;
50
50
  this.console = managers.console;
@@ -1,7 +1,7 @@
1
1
  ///////////////////////////////////////
2
2
  //EVENT MODULE
3
3
  ///////////////////////////////////////
4
- import { ODManagerData, ODManager, ODSystemError } from "./base.js";
4
+ import { ODManagerData, ODManager } from "./base.js";
5
5
  import { ODWarningConsoleMessage } from "./console.js";
6
6
  /**## ODEvent `class`
7
7
  * This is an Open Discord event.
@@ -62,7 +62,7 @@ export class ODEvent extends ODManagerData {
62
62
  await listener(...params);
63
63
  }
64
64
  catch (err) {
65
- process.emit("uncaughtException", new ODSystemError(err));
65
+ process.emit("uncaughtException", err);
66
66
  }
67
67
  }
68
68
  }
@@ -89,7 +89,8 @@ export class ODPlugin extends ODManagerData {
89
89
  try {
90
90
  //import relative plugin directory path (works on windows & unix based systems)
91
91
  const pluginPath = nodepath.join(process.cwd(), "./dist/plugins/", this.getStartFile()).replaceAll("\\", "/");
92
- await import(pluginPath);
92
+ const finalPathForWindows = (process.platform == "win32") ? "file://" + pluginPath : pluginPath;
93
+ await import(finalPathForWindows);
93
94
  debug.console.log("Plugin \"" + this.id.value + "\" loaded successfully!", "plugin");
94
95
  this.executed = true;
95
96
  return true;
@@ -1310,9 +1310,16 @@ export class ODModalResponderInstance extends ODBaseResponderInstance {
1310
1310
  async reply(build) {
1311
1311
  try {
1312
1312
  const finalMessage = this.getMessageFromBuildResult(build, "interaction");
1313
- const sent = await this.interaction.reply(finalMessage);
1314
- this.ignoreResponderTimeout = true;
1315
- return { success: true, message: await sent.fetch(), ephemeral: build.ephemeral };
1313
+ if (this.interaction.replied || this.interaction.deferred) {
1314
+ const sent = await this.interaction.editReply(finalMessage);
1315
+ this.ignoreResponderTimeout = true;
1316
+ return { success: true, message: await sent.fetch(), ephemeral: build.ephemeral };
1317
+ }
1318
+ else {
1319
+ const sent = await this.interaction.reply(finalMessage);
1320
+ this.ignoreResponderTimeout = true;
1321
+ return { success: true, message: await sent.fetch(), ephemeral: build.ephemeral };
1322
+ }
1316
1323
  }
1317
1324
  catch (err) {
1318
1325
  process.emit("uncaughtException", err);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@open-discord-bots/framework",
3
3
  "author": "DJj123dj",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
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",