revert: remove AnyDependencies type

This commit is contained in:
Jacob Nguyen
2023-05-06 03:13:02 -05:00
parent 43181bf916
commit 4794c2655d
5 changed files with 14 additions and 18 deletions

View File

@@ -11,7 +11,7 @@ import { SernError } from '../../core/structures/errors';
import { filterMap } from '../../core/operators';
import { defaultModuleLoader } from '../../core/module-loading';
import { Processed } from '../../types/core';
import { BothCommand, CommandModule, Module } from '../../types/module';
import { BothCommand, CommandModule } from '../../types/module';
import { contextArgs, dispatchAutocomplete, dispatchCommand, interactionArg } from './dispatchers';
import { isAutocomplete } from '../../core/predicates';
import { ObservableInput, pipe, switchMap } from 'rxjs';

View File

@@ -1,9 +1,9 @@
import { BaseInteraction, Interaction } from 'discord.js';
import { Interaction } from 'discord.js';
import { catchError, concatMap, finalize, merge } from 'rxjs';
import { SernError } from '../../core/structures/errors';
import { executeModule, makeModuleExecutor } from './observableHandling';
import { ErrorHandling, handleError } from '../../core/contracts/errorHandling';
import { SernEmitter, WebsocketStrategy } from '../../core';
import { SernEmitter } from '../../core';
import { sharedObservable } from '../../core/operators';
import { useContainerRaw } from '../../core/dependencies';
import type { Logging, ModuleManager } from '../../core/contracts';

View File

@@ -1,18 +1,12 @@
import { catchError, concatMap, EMPTY, finalize, map, pipe } from 'rxjs';
import { catchError, concatMap, EMPTY, finalize } from 'rxjs';
import { SernError } from '../../core/structures/errors';
import type { Message } from 'discord.js';
import { executeModule, ignoreNonBot, makeModuleExecutor } from './observableHandling';
import type { CommandModule } from '../../types/module';
import { ErrorHandling, handleError } from '../../core/contracts/errorHandling';
import { contextArgs, dispatchCommand } from './dispatchers';
import type { Processed } from '../../types/core';
import { useContainerRaw } from '../../core/dependencies';
import type { Logging, ModuleManager } from '../../core/contracts';
import type { EventEmitter } from 'node:events';
import { WebsocketStrategy, SernEmitter } from '../../core';
import { err } from '../../core/functions';
import { defaultModuleLoader } from '../../core/module-loading';
import { sharedObservable, filterMap } from '../../core/operators';
import { SernEmitter, useContainerRaw } from '../../core';
import { sharedObservable } from '../../core/operators';
import { createMessageHandler } from './generic';
/**

View File

@@ -1,10 +1,10 @@
import { ObservableInput, fromEvent, of, take } from 'rxjs';
import { ObservableInput, fromEvent, take } from 'rxjs';
import { callInitPlugins } from './observableHandling';
import { CommandType } from '../../core/structures';
import { SernError } from '../../core/structures/errors';
import { Result } from 'ts-results-es';
import type { ModuleManager } from '../../core/contracts';
import { SernEmitter, PlatformStrategy, DispatchType } from '../../core';
import { ModuleManager } from '../../core/contracts';
import { SernEmitter, } from '../../core';
import { sernMeta } from '../../commands';
import { Processed, ServerlessDependencyList, WebsocketDependencyList } from '../../types/core';
import { Module } from '../../types/module';
@@ -17,7 +17,7 @@ export function startReadyEvent(
| WebsocketDependencyList,
input: ObservableInput<string>,
) {
const ready$ = fromEvent(client!, 'interactionCreate').pipe(take(1));
const ready$ = fromEvent(client!, 'ready').pipe(take(1));
return ready$
.pipe(
buildModules(input, sEmitter),
@@ -54,3 +54,5 @@ function registerModule<T extends Processed<Module>>(
}
return Result.wrap(() => manager.set(id, fullPath));
}

View File

@@ -1,5 +1,5 @@
import { catchError, finalize, map, mergeAll, of } from 'rxjs';
import type { Processed, WebsocketDependencies, Wrapper } from '../../types/core';
import type { Dependencies, Processed, Wrapper } from '../../types/core';
import { callInitPlugins } from './observableHandling';
import type { CommandModule, EventModule } from '../../types/module';
import type { EventEmitter } from 'node:events';
@@ -17,7 +17,7 @@ export function makeEventsHandler(
eventsPath: string,
containerGetter: Wrapper['containerConfig'],
) {
const lazy = (k: string) => containerGetter.get(k as keyof WebsocketDependencies)[0];
const lazy = (k: string) => containerGetter.get(k as keyof Dependencies)[0];
const intoDispatcher = (e: Processed<EventModule | CommandModule>) => {
switch (e.type) {
case EventType.Sern: