build : Added ts-pattern for pattern matching with command types and

plugin types
This commit is contained in:
Jacob Nguyen
2022-05-07 21:07:10 -05:00
parent 2f61399b5e
commit 57dc0bac88
3 changed files with 17 additions and 6 deletions

View File

@@ -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 => {