mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
more refactoring
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import type { Result } from 'ts-results-es'
|
||||
|
||||
export * as Id from './id';
|
||||
export * from './operators';
|
||||
export * as Files from './module-loading';
|
||||
export * from './functions';
|
||||
export { SernError } from './structures/enums';
|
||||
export { useContainerRaw } from './ioc/base';
|
||||
|
||||
@@ -45,7 +45,8 @@ export function callPlugin(args: unknown): OperatorFunction<PluginExecutable, Vo
|
||||
});
|
||||
}
|
||||
|
||||
export const arrayifySource = <T>(src: T) => (Array.isArray(src) ? (src as unknown[]) : [src]);
|
||||
export const arrayifySource = <T>(src: T) =>
|
||||
Array.isArray(src) ? src : [src];
|
||||
|
||||
/**
|
||||
* Checks if the stream of results is all ok.
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
pipe
|
||||
} from 'rxjs';
|
||||
import {
|
||||
Id,
|
||||
callPlugin,
|
||||
everyPluginOk,
|
||||
filterMapTo,
|
||||
@@ -27,6 +26,7 @@ import {
|
||||
treeSearch,
|
||||
_Module,
|
||||
} from '../core/_internal';
|
||||
import * as Id from '../core/id'
|
||||
import type { Emitter, ErrorHandling, Logging } from '../core/interfaces';
|
||||
import { PayloadType } from '../core/structures/enums'
|
||||
import { Err, Ok, Result } from 'ts-results-es';
|
||||
|
||||
@@ -25,9 +25,7 @@ export function messageHandler(
|
||||
defaultPrefix: string | undefined,
|
||||
) {
|
||||
if (!defaultPrefix) {
|
||||
log?.debug({
|
||||
message: 'No prefix found. message handler shutting down',
|
||||
});
|
||||
log?.debug({ message: 'No prefix found. message handler shutting down' });
|
||||
return EMPTY;
|
||||
}
|
||||
const messageStream$ = sharedEventStream<Message>(client, 'messageCreate');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { concatMap, from, interval, of, map, scan, startWith, fromEvent, take } from "rxjs"
|
||||
import { Files } from "../core/_internal";
|
||||
import * as Files from "../core/module-loading";
|
||||
import { PresenceConfig, PresenceResult } from "../core/presences";
|
||||
import { Services } from "../core/ioc";
|
||||
import assert from "node:assert";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import callsites from 'callsites';
|
||||
import { Files } from './core/_internal';
|
||||
import * as Files from './core/module-loading';
|
||||
import { Services } from './core/ioc';
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,7 +48,7 @@ import type {
|
||||
UserContextMenuCommandInteraction,
|
||||
UserSelectMenuInteraction,
|
||||
} from 'discord.js';
|
||||
import type { VoidResult } from '../core/_internal';
|
||||
import { VoidResult } from '../core/_internal';
|
||||
|
||||
export type PluginResult = Awaitable<VoidResult>;
|
||||
|
||||
@@ -82,8 +82,7 @@ export type CommandArgs<
|
||||
J extends PluginType = PluginType,
|
||||
> = CommandArgsMatrix[I][J];
|
||||
|
||||
export type EventArgs<
|
||||
I extends EventType = EventType,
|
||||
export type EventArgs< I extends EventType = EventType,
|
||||
J extends PluginType = PluginType,
|
||||
> = EventArgsMatrix[I][J];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user