mirror of
https://github.com/sern-handler/handler
synced 2026-06-17 05:12:16 +00:00
fix(messageEvent) : fix access location for messages
This commit is contained in:
@@ -13,9 +13,18 @@ export const onInteractionCreate = ( wrapper : Wrapper ) => {
|
||||
const { client } = wrapper;
|
||||
|
||||
const interactionEvent = (<Observable<Interaction>> 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()) {
|
||||
|
||||
@@ -23,7 +23,7 @@ export const onMessageCreate = (wrapper : Wrapper) => {
|
||||
return {
|
||||
ctx : Context.wrap(message),
|
||||
args : <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) => {
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -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<string, PluggedModule>()
|
||||
}
|
||||
export const TextCommandStore = {
|
||||
[420] : new Map<string, PluggedModule>() // Aliases
|
||||
[CommandType.Text] : new Map<string, PluggedModule>() // Aliases
|
||||
}
|
||||
|
||||
export const Alias = new Map<string, PluggedModule>();
|
||||
|
||||
export const ContextMenuUser = new Map<string, PluggedModule>();
|
||||
export const ContextMenuMsg = new Map<string, PluggedModule>();
|
||||
export const Buttons = new Map<string, PluggedModule>();
|
||||
export const SelectMenus = new Map<string, PluggedModule>();
|
||||
|
||||
|
||||
// Courtesy @Townsy45
|
||||
function readPath(dir: string, arrayOfFiles: string[] = []): string[] {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user