mirror of
https://github.com/sern-handler/handler
synced 2026-07-05 05:59:37 +00:00
build : Added ts-pattern for pattern matching with command types and
plugin types
This commit is contained in:
@@ -3,6 +3,8 @@ import { ApplicationCommandType, Interaction } from 'discord.js';
|
||||
import { fromEvent, Observable, of, concatMap, map, filter } from 'rxjs';
|
||||
import { CommandType } from '../sern';
|
||||
import Context from '../structures/context';
|
||||
import type { ModuleDefs } from '../structures/modules/commands/moduleHandler';
|
||||
import type { PluggedModule } from '../structures/modules/module';
|
||||
import type Wrapper from '../structures/wrapper';
|
||||
import * as Files from '../utilities/readFile';
|
||||
import { match, partition } from './observableHandling';
|
||||
@@ -16,9 +18,6 @@ export const onInteractionCreate = ( wrapper : Wrapper ) => {
|
||||
|
||||
const interactionEvent$ = (<Observable<Interaction>> fromEvent(client, 'interactionCreate'))
|
||||
|
||||
const processPlugins = <T extends keyof ModuleDefs>( plug : Observable<PluggedModule|undefined> ) => {
|
||||
return plug
|
||||
};
|
||||
|
||||
const processCommand$ = interactionEvent$.pipe(
|
||||
concatMap( interaction => {
|
||||
|
||||
Reference in New Issue
Block a user