diff --git a/src/handler/events/interactionCreate.ts b/src/handler/events/interactionCreate.ts index d2d7a0a..645d502 100644 --- a/src/handler/events/interactionCreate.ts +++ b/src/handler/events/interactionCreate.ts @@ -13,9 +13,18 @@ export const onInteractionCreate = ( wrapper : Wrapper ) => { const { client } = wrapper; const interactionEvent = (> fromEvent(client, 'interactionCreate')) - + interactionEvent.pipe( - tap(console.log) + concatMap ( async interaction => { + if(interaction.isCommand()) { + return of( + Files.ApplicationCommandStore[interaction.commandType] + .get(interaction.commandName)).pipe( + + ) + } + + }) ).subscribe() /** concatMap (async interaction => { if (interaction.isChatInputCommand()) { diff --git a/src/handler/events/messageEvent.ts b/src/handler/events/messageEvent.ts index 6b4de1f..1ce5bad 100644 --- a/src/handler/events/messageEvent.ts +++ b/src/handler/events/messageEvent.ts @@ -23,7 +23,7 @@ export const onMessageCreate = (wrapper : Wrapper) => { return { ctx : Context.wrap(message), args : ['text', rest], - mod : Files.Commands.get(prefix) ?? Files.Alias.get(prefix) + mod : Files.ApplicationCommandStore[1].get(prefix) ?? Files.Alias.get(prefix) } })); @@ -60,7 +60,4 @@ export const onMessageCreate = (wrapper : Wrapper) => { } }) - - - }; diff --git a/src/handler/utilities/readFile.ts b/src/handler/utilities/readFile.ts index abc0365..305571a 100644 --- a/src/handler/utilities/readFile.ts +++ b/src/handler/utilities/readFile.ts @@ -2,6 +2,7 @@ import { ApplicationCommandType, ComponentType, InteractionType, MessageComponen import { readdirSync, statSync } from 'fs'; import { join } from 'path'; import { from, Observable } from 'rxjs'; +import { CommandType } from '../sern'; import type { PluggedModule } from '../structures/modules/module'; @@ -17,17 +18,10 @@ export const MessageCompCommandStore = { [ComponentType.SelectMenu] : new Map() } export const TextCommandStore = { - [420] : new Map() // Aliases + [CommandType.Text] : new Map() // Aliases } - export const Alias = new Map(); -export const ContextMenuUser = new Map(); -export const ContextMenuMsg = new Map(); -export const Buttons = new Map(); -export const SelectMenus = new Map(); - - // Courtesy @Townsy45 function readPath(dir: string, arrayOfFiles: string[] = []): string[] { try {