@open-discord-bots/framework 2.0.0 → 2.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/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.
|
|
47
|
+
this.versions.add(ODVersion.fromString("opendiscord:api", "v2.0.2"));
|
|
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
|
|
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",
|
|
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
|
-
|
|
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;
|
|
@@ -631,7 +631,7 @@ export class ODButtonResponderInstance extends ODBaseResponderInstance {
|
|
|
631
631
|
if (this.interaction.replied || this.interaction.deferred) {
|
|
632
632
|
const sent = await this.interaction.editReply(finalMessage);
|
|
633
633
|
this.ignoreResponderTimeout = true;
|
|
634
|
-
return { success: true, message:
|
|
634
|
+
return { success: true, message: sent, ephemeral: build.ephemeral };
|
|
635
635
|
}
|
|
636
636
|
else {
|
|
637
637
|
const sent = await this.interaction.update(finalMessage);
|
|
@@ -972,7 +972,7 @@ export class ODDropdownResponderInstance extends ODBaseResponderInstance {
|
|
|
972
972
|
if (this.interaction.replied || this.interaction.deferred) {
|
|
973
973
|
const sent = await this.interaction.editReply(finalMessage);
|
|
974
974
|
this.ignoreResponderTimeout = true;
|
|
975
|
-
return { success: true, message:
|
|
975
|
+
return { success: true, message: sent, ephemeral: build.ephemeral };
|
|
976
976
|
}
|
|
977
977
|
else {
|
|
978
978
|
const sent = await this.interaction.update(finalMessage);
|
|
@@ -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
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
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: sent, 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);
|
|
@@ -1326,7 +1333,7 @@ export class ODModalResponderInstance extends ODBaseResponderInstance {
|
|
|
1326
1333
|
if (this.interaction.replied || this.interaction.deferred) {
|
|
1327
1334
|
const sent = await this.interaction.editReply(finalMessage);
|
|
1328
1335
|
this.ignoreResponderTimeout = true;
|
|
1329
|
-
return { success: true, message:
|
|
1336
|
+
return { success: true, message: sent, ephemeral: build.ephemeral };
|
|
1330
1337
|
}
|
|
1331
1338
|
else {
|
|
1332
1339
|
const sent = await this.interaction.reply(finalMessage);
|
|
@@ -1498,7 +1505,7 @@ export class ODContextMenuResponderInstance extends ODBaseResponderInstance {
|
|
|
1498
1505
|
if (this.interaction.replied || this.interaction.deferred) {
|
|
1499
1506
|
const sent = await this.interaction.editReply(finalMessage);
|
|
1500
1507
|
this.ignoreResponderTimeout = true;
|
|
1501
|
-
return { success: true, message:
|
|
1508
|
+
return { success: true, message: sent, ephemeral: build.ephemeral };
|
|
1502
1509
|
}
|
|
1503
1510
|
else
|
|
1504
1511
|
throw new ODSystemError("Unable to update context menu interaction!");
|
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.
|
|
4
|
+
"version": "2.0.2",
|
|
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",
|