Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
🔨 Build v2.0.0-04.06.22-05
Browse files Browse the repository at this point in the history
  • Loading branch information
fh-prv committed Jun 4, 2022
1 parent 8ed49ca commit 5b6349a
Show file tree
Hide file tree
Showing 66 changed files with 148 additions and 102 deletions.
2 changes: 1 addition & 1 deletion docs/Badges.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/BaseComponent.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/BaseInteraction.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/BaseTicket.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/BaseTicketManager.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ButtonInteraction.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ButtonInteractionManager.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/Colors.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ContextInteraction.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ContextInteractionManager.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/DisGroupDevError.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/Emojis.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/Event.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/EventManager.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/InteractionManager.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/Logger.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ModalInteraction.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ModalInteractionManager.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/Partner.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/SelectMenuInteraction.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/SelectMenuInteractionManager.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/SlashCommand.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/SlashCommandInteractionManager.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/StatusPageChecker.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/TextTicket.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/TextTicketManager.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/TranslationManager.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/Utilities.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/errors_DisGroupDevError.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/global.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/managers_BaseTicketManager.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/managers_EventManager.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/managers_InteractionManager.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/managers_StatusPageChecker.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/managers_TextTicketManager.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/managers_TranslationManager.js.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/managers_interaction_ButtonInteractionManager.js.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/managers_interaction_ContextInteractionManager.js.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/managers_interaction_ModalInteractionManager.js.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/managers_interaction_SelectMenuInteractionManager.js.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/managers_interaction_SlashCommandInteractionManager.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/structures_BaseTicket.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/structures_Event.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/structures_TextTicket.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/structures_interaction_BaseComponent.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/structures_interaction_BaseInteraction.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/structures_interaction_ButtonInteraction.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/structures_interaction_ContextInteraction.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/structures_interaction_ModalInteraction.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/structures_interaction_SelectMenuInteraction.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/structures_interaction_SlashCommand.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/utils_Badges.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/utils_Colors.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/utils_Emojis.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/utils_Logger.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/utils_Partner.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/utils_Utilities.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/managers/EventManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions lib/managers/interaction/ButtonInteractionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {

Expand Down Expand Up @@ -187,7 +187,7 @@ class ButtonInteractionManager {

for(const buttonInteraction of this.cache) {

await this.unload(buttonInteraction.name);
await this.unload(buttonInteraction[1].name);

}

Expand Down Expand Up @@ -256,7 +256,7 @@ class ButtonInteractionManager {

for(const buttonInteraction of this.cache) {

await this.unload(buttonInteraction.name);
await this.unload(buttonInteraction[1].name);

}

Expand Down
8 changes: 4 additions & 4 deletions lib/managers/interaction/ContextInteractionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {

Expand Down Expand Up @@ -290,7 +290,7 @@ class ContextInteractionManager {

for(const contextInteraction of this.cache) {

await this.unload(contextInteraction.name);
await this.unload(contextInteraction[1].name);

}

Expand Down Expand Up @@ -359,7 +359,7 @@ class ContextInteractionManager {

for(const contextInteraction of this.cache) {

await this.unload(contextInteraction.name);
await this.unload(contextInteraction[1].name);

}

Expand Down
8 changes: 4 additions & 4 deletions lib/managers/interaction/ModalInteractionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {

Expand Down Expand Up @@ -187,7 +187,7 @@ class ModalInteractionManager {

for(const modalInteraction of this.cache) {

await this.unload(modalInteraction.name);
await this.unload(modalInteraction[1].name);

}

Expand Down Expand Up @@ -256,7 +256,7 @@ class ModalInteractionManager {

for(const modalInteraction of this.cache) {

await this.unload(modalInteraction.name);
await this.unload(modalInteraction[1].name);

}

Expand Down
8 changes: 4 additions & 4 deletions lib/managers/interaction/SelectMenuInteractionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {

Expand Down Expand Up @@ -187,7 +187,7 @@ class SelectMenuInteractionManager {

for(const selectMenuInteraction of this.cache) {

await this.unload(selectMenuInteraction.name);
await this.unload(selectMenuInteraction[1].name);

}

Expand Down Expand Up @@ -256,7 +256,7 @@ class SelectMenuInteractionManager {

for(const selectMenuInteraction of this.cache) {

await this.unload(selectMenuInteraction.name);
await this.unload(selectMenuInteraction[1].name);

}

Expand Down
10 changes: 5 additions & 5 deletions lib/managers/interaction/SlashCommandInteractionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {

Expand Down Expand Up @@ -290,7 +290,7 @@ class SlashCommandInteractionManager {

for(const slashCommand of this.cache) {

await this.unload(slashCommand.name);
await this.unload(slashCommand[1].name);

}

Expand Down Expand Up @@ -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);

}

Expand Down
27 changes: 27 additions & 0 deletions test/Interactions/Slash/General/Ping.js
Original file line number Diff line number Diff line change
@@ -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;
19 changes: 19 additions & 0 deletions test/loadInteractions.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 5b6349a

Please sign in to comment.