fix: autocomplete

This commit is contained in:
Jacob Nguyen
2023-02-12 12:51:49 -06:00
parent fd10772a9b
commit 1860b898f3
3 changed files with 4 additions and 4 deletions

View File

@@ -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",

View File

@@ -54,7 +54,7 @@ export function dispatchAutocomplete(
const option = treeSearch(interaction, module.options);
if (option !== undefined) {
return {
module,
module: option.command as Processed<Module>, //autocomplete is not a true "module" warning cast!
args: [interaction],
};
}

View File

@@ -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<Module>,
T extends { execute: (...args: any[]) => any; onEvent : ControlPlugin[] },
Args extends { module: T; [key: string]: unknown },
Output,
>(config: {