mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
some refactor
This commit is contained in:
@@ -189,11 +189,7 @@ export function executeModule(
|
||||
emitter: Emitter,
|
||||
logger: Logging|undefined,
|
||||
errHandler: ErrorHandling,
|
||||
{
|
||||
module,
|
||||
task,
|
||||
args
|
||||
}: ExecutePayload,
|
||||
{ module, task, args }: ExecutePayload,
|
||||
) {
|
||||
return of(module).pipe(
|
||||
//converting the task into a promise so rxjs can resolve the Awaitable properly
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { mergeMap, EMPTY, concatMap } from 'rxjs';
|
||||
import { EMPTY } from 'rxjs';
|
||||
import type { Message } from 'discord.js';
|
||||
import { PayloadType } from '../core/structures/enums';
|
||||
import { sharedEventStream, SernError, filterTap, resultPayload } from '../core/_internal';
|
||||
import { createMessageHandler, executeModule, makeModuleExecutor } from './event-utils';
|
||||
import { sharedEventStream } from '../core/_internal';
|
||||
import type { DependencyList } from '../types/ioc';
|
||||
|
||||
/**
|
||||
@@ -15,9 +13,7 @@ function isNonBot(prefix: string) {
|
||||
|
||||
function hasPrefix(prefix: string, content: string) {
|
||||
const prefixInContent = content.slice(0, prefix.length);
|
||||
return (prefixInContent.localeCompare(prefix, undefined, {
|
||||
sensitivity: 'accent',
|
||||
}) === 0);
|
||||
return (prefixInContent.localeCompare(prefix, undefined, { sensitivity: 'accent', }) === 0);
|
||||
}
|
||||
|
||||
export function messageHandler(
|
||||
|
||||
Reference in New Issue
Block a user