From 1860b898f3a231840e2a8b781e007ef9d6f587a4 Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Sun, 12 Feb 2023 12:51:49 -0600 Subject: [PATCH] fix: autocomplete --- package.json | 2 +- src/handler/events/dispatchers/dispatchers.ts | 2 +- src/handler/events/observableHandling.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ee4af93..69e2bbb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@sern/handler", "packageManager": "pnpm@7.27.0", - "version": "2.5.0", + "version": "2.5.1", "description": "A customizable, batteries-included, powerful discord.js framework to automate and streamline bot development.", "main": "dist/cjs/index.cjs", "module": "dist/esm/index.mjs", diff --git a/src/handler/events/dispatchers/dispatchers.ts b/src/handler/events/dispatchers/dispatchers.ts index b1acbed..81855f0 100644 --- a/src/handler/events/dispatchers/dispatchers.ts +++ b/src/handler/events/dispatchers/dispatchers.ts @@ -54,7 +54,7 @@ export function dispatchAutocomplete( const option = treeSearch(interaction, module.options); if (option !== undefined) { return { - module, + module: option.command as Processed, //autocomplete is not a true "module" warning cast! args: [interaction], }; } diff --git a/src/handler/events/observableHandling.ts b/src/handler/events/observableHandling.ts index d627fe5..9f09ff1 100644 --- a/src/handler/events/observableHandling.ts +++ b/src/handler/events/observableHandling.ts @@ -7,7 +7,7 @@ import { _const as i } from '../utilities/functions'; import SernEmitter from '../sernEmitter'; import { callPlugin, everyPluginOk, filterMapTo } from './operators'; import type { Processed } from '../../types/handler'; -import type { VoidResult } from '../../types/plugin'; +import type { ControlPlugin, VoidResult } from '../../types/plugin'; /** * Ignores messages from any person / bot except itself @@ -94,7 +94,7 @@ export function executeModule( * @returns receiver function for flattening a stream of data */ export function createResultResolver< - T extends Processed, + T extends { execute: (...args: any[]) => any; onEvent : ControlPlugin[] }, Args extends { module: T; [key: string]: unknown }, Output, >(config: {