diff --git a/lib/managers/EventManager.js b/lib/managers/EventManager.js
index 3a0d51d..0d71880 100644
--- a/lib/managers/EventManager.js
+++ b/lib/managers/EventManager.js
@@ -67,7 +67,7 @@ class EventManager extends EventEmitter {
/** @type {Event} */
const eventFile = new (require(path))(this.client, this);
- if(!eventFile.enabled) reject(new DisGroupDevError(Messages.EVENT_NOT_ENABLED));
+ if(!eventFile.enabled) reject(Messages.EVENT_NOT_ENABLED);
eventFile.location = path;
diff --git a/lib/managers/interaction/ButtonInteractionManager.js b/lib/managers/interaction/ButtonInteractionManager.js
index 200ab0d..d38c5bf 100644
--- a/lib/managers/interaction/ButtonInteractionManager.js
+++ b/lib/managers/interaction/ButtonInteractionManager.js
@@ -57,7 +57,7 @@ class ButtonInteractionManager {
/** @type {ButtonInteraction} */
const buttonInteraction = new(require(path))(this.client, this.manager);
- if(!buttonInteraction.enabled) reject(new DisGroupDevError(Messages.INTERACTION_NOT_ENABLED));
+ if(!buttonInteraction.enabled) reject(Messages.INTERACTION_NOT_ENABLED);
buttonInteraction.location = path;
@@ -105,7 +105,7 @@ class ButtonInteractionManager {
if(buttonInteractionDirectoryStat.isDirectory()) {
- const buttonInteractionDirectoryCategory = await readDirectory(require('node:paht').resolve(this.manager.options.locationButtonInteractions, buttonInteractionDirectoryCategoryOrFile));
+ const buttonInteractionDirectoryCategory = await readDirectory(require('node:path').resolve(this.manager.options.locationButtonInteractions, buttonInteractionDirectoryCategoryOrFile));
for(const buttonInteractionDirectoryCategoryFile of buttonInteractionDirectoryCategory) {
@@ -187,7 +187,7 @@ class ButtonInteractionManager {
for(const buttonInteraction of this.cache) {
- await this.unload(buttonInteraction.name);
+ await this.unload(buttonInteraction[1].name);
}
@@ -256,7 +256,7 @@ class ButtonInteractionManager {
for(const buttonInteraction of this.cache) {
- await this.unload(buttonInteraction.name);
+ await this.unload(buttonInteraction[1].name);
}
diff --git a/lib/managers/interaction/ContextInteractionManager.js b/lib/managers/interaction/ContextInteractionManager.js
index c742b4b..468e374 100644
--- a/lib/managers/interaction/ContextInteractionManager.js
+++ b/lib/managers/interaction/ContextInteractionManager.js
@@ -160,7 +160,7 @@ class ContextInteractionManager {
/** @type {ContextInteraction} */
const contextInteraction = new(require(path))(this.client, this.manager);
- if(!contextInteraction.enabled) reject(new DisGroupDevError(Messages.INTERACTION_NOT_ENABLED));
+ if(!contextInteraction.enabled) reject(Messages.INTERACTION_NOT_ENABLED);
contextInteraction.location = path;
@@ -208,7 +208,7 @@ class ContextInteractionManager {
if(contextInteractionDirectoryStat.isDirectory()) {
- const contextInteractionDirectoryCategory = await readDirectory(require('node:paht').resolve(this.manager.options.locationContextInteractions, contextInteractionDirectoryCategoryOrFile));
+ const contextInteractionDirectoryCategory = await readDirectory(require('node:path').resolve(this.manager.options.locationContextInteractions, contextInteractionDirectoryCategoryOrFile));
for(const contextInteractionDirectoryCategoryFile of contextInteractionDirectoryCategory) {
@@ -290,7 +290,7 @@ class ContextInteractionManager {
for(const contextInteraction of this.cache) {
- await this.unload(contextInteraction.name);
+ await this.unload(contextInteraction[1].name);
}
@@ -359,7 +359,7 @@ class ContextInteractionManager {
for(const contextInteraction of this.cache) {
- await this.unload(contextInteraction.name);
+ await this.unload(contextInteraction[1].name);
}
diff --git a/lib/managers/interaction/ModalInteractionManager.js b/lib/managers/interaction/ModalInteractionManager.js
index 38123be..b554c1b 100644
--- a/lib/managers/interaction/ModalInteractionManager.js
+++ b/lib/managers/interaction/ModalInteractionManager.js
@@ -57,7 +57,7 @@ class ModalInteractionManager {
/** @type {ModalInteraction} */
const modalInteraction = new(require(path))(this.client, this.manager);
- if(!modalInteraction.enabled) reject(new DisGroupDevError(Messages.INTERACTION_NOT_ENABLED));
+ if(!modalInteraction.enabled) reject(Messages.INTERACTION_NOT_ENABLED);
modalInteraction.location = path;
@@ -105,7 +105,7 @@ class ModalInteractionManager {
if(modalInteractionDirectoryStat.isDirectory()) {
- const modalInteractionDirectoryCategory = await readDirectory(require('node:paht').resolve(this.manager.options.locationModalInteractions, modalInteractionDirectoryCategoryOrFile));
+ const modalInteractionDirectoryCategory = await readDirectory(require('node:path').resolve(this.manager.options.locationModalInteractions, modalInteractionDirectoryCategoryOrFile));
for(const modalInteractionDirectoryCategoryFile of modalInteractionDirectoryCategory) {
@@ -187,7 +187,7 @@ class ModalInteractionManager {
for(const modalInteraction of this.cache) {
- await this.unload(modalInteraction.name);
+ await this.unload(modalInteraction[1].name);
}
@@ -256,7 +256,7 @@ class ModalInteractionManager {
for(const modalInteraction of this.cache) {
- await this.unload(modalInteraction.name);
+ await this.unload(modalInteraction[1].name);
}
diff --git a/lib/managers/interaction/SelectMenuInteractionManager.js b/lib/managers/interaction/SelectMenuInteractionManager.js
index 77ad755..95d9471 100644
--- a/lib/managers/interaction/SelectMenuInteractionManager.js
+++ b/lib/managers/interaction/SelectMenuInteractionManager.js
@@ -57,7 +57,7 @@ class SelectMenuInteractionManager {
/** @type {SelectMenuInteraction} */
const selectMenuInteraction = new(require(path))(this.client, this.manager);
- if(!selectMenuInteraction.enabled) reject(new DisGroupDevError(Messages.INTERACTION_NOT_ENABLED));
+ if(!selectMenuInteraction.enabled) reject(Messages.INTERACTION_NOT_ENABLED);
selectMenuInteraction.location = path;
@@ -105,7 +105,7 @@ class SelectMenuInteractionManager {
if(selectMenuInteractionDirectoryStat.isDirectory()) {
- const selectMenuInteractionDirectoryCategory = await readDirectory(require('node:paht').resolve(this.manager.options.locationSelectMenuInteractions, selectMenuInteractionDirectoryCategoryOrFile));
+ const selectMenuInteractionDirectoryCategory = await readDirectory(require('node:path').resolve(this.manager.options.locationSelectMenuInteractions, selectMenuInteractionDirectoryCategoryOrFile));
for(const selectMenuInteractionDirectoryCategoryFile of selectMenuInteractionDirectoryCategory) {
@@ -187,7 +187,7 @@ class SelectMenuInteractionManager {
for(const selectMenuInteraction of this.cache) {
- await this.unload(selectMenuInteraction.name);
+ await this.unload(selectMenuInteraction[1].name);
}
@@ -256,7 +256,7 @@ class SelectMenuInteractionManager {
for(const selectMenuInteraction of this.cache) {
- await this.unload(selectMenuInteraction.name);
+ await this.unload(selectMenuInteraction[1].name);
}
diff --git a/lib/managers/interaction/SlashCommandInteractionManager.js b/lib/managers/interaction/SlashCommandInteractionManager.js
index 42ae7f2..e5931db 100644
--- a/lib/managers/interaction/SlashCommandInteractionManager.js
+++ b/lib/managers/interaction/SlashCommandInteractionManager.js
@@ -160,7 +160,7 @@ class SlashCommandInteractionManager {
/** @type {SlashCommand} */
const slashCommand = new(require(path))(this.client, this.manager);
- if(!slashCommand.enabled) reject(new DisGroupDevError(Messages.INTERACTION_NOT_ENABLED));
+ if(!slashCommand.enabled) reject(Messages.INTERACTION_NOT_ENABLED);
slashCommand.location = path;
@@ -208,7 +208,7 @@ class SlashCommandInteractionManager {
if(slashCommandDirectoryStat.isDirectory()) {
- const slashCommandDirectoryCategory = await readDirectory(require('node:paht').resolve(this.manager.options.locationSlashCommands, slashCommandDirectoryCategoryOrFile));
+ const slashCommandDirectoryCategory = await readDirectory(require('node:path').resolve(this.manager.options.locationSlashCommands, slashCommandDirectoryCategoryOrFile));
for(const slashCommandDirectoryCategoryFile of slashCommandDirectoryCategory) {
@@ -290,7 +290,7 @@ class SlashCommandInteractionManager {
for(const slashCommand of this.cache) {
- await this.unload(slashCommand.name);
+ await this.unload(slashCommand[1].name);
}
@@ -358,8 +358,8 @@ class SlashCommandInteractionManager {
try {
for(const slashCommand of this.cache) {
-
- await this.unload(slashCommand.name);
+console.log(slashCommand[1])
+ await this.unload(slashCommand[1].name);
}
diff --git a/test/Interactions/Slash/General/Ping.js b/test/Interactions/Slash/General/Ping.js
new file mode 100644
index 0000000..ee2edb2
--- /dev/null
+++ b/test/Interactions/Slash/General/Ping.js
@@ -0,0 +1,27 @@
+const Discord = require('discord.js');
+
+const { SlashCommand } = require('../../../../lib');
+
+class Ping extends SlashCommand {
+
+ constructor(client, manager) {
+
+ super(client, manager, {
+
+ name: 'ping',
+ description: 'pong',
+ enabled: true
+
+ });
+
+ }
+
+ execute(interaction) {
+
+
+
+ }
+
+}
+
+module.exports = Ping;
\ No newline at end of file
diff --git a/test/loadInteractions.js b/test/loadInteractions.js
index aa35595..85dac50 100644
--- a/test/loadInteractions.js
+++ b/test/loadInteractions.js
@@ -1,2 +1,21 @@
const { InteractionManager } = require('../lib');
+const { Client, Intents } = require('discord.js');
+const { token } = require('./auth.js');
+const client = new Client({ intents: [ Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES ] });
+
+client.interactions = new InteractionManager(client, { locationSlashCommands: require('node:path').join(__dirname, './Interactions/Slash') });
+
+client.login(token)
+
+setTimeout(async () => {
+
+ await client.interactions.slash.loadAll();
+
+ //console.log(client.interactions.slash.cache);
+
+ await client.interactions.slash.unloadAll();
+
+ console.log(client.interactions.slash.cache);
+
+}, 2000);
\ No newline at end of file