mirror of
https://github.com/sern-handler/handler
synced 2026-06-26 09:42:15 +00:00
feat: Making name required in auto cmp interactions
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { concat, concatMap, from, fromEvent, map, Observable, of, skip, take } from 'rxjs';
|
||||
import { concat, concatMap, from, fromEvent, map, Observable, of, skip, take, throwError } from 'rxjs';
|
||||
import { basename } from 'path';
|
||||
import * as Files from '../utilities/readFile';
|
||||
import type Wrapper from '../structures/wrapper';
|
||||
@@ -27,6 +27,9 @@ export const onReady = (wrapper: Wrapper) => {
|
||||
);
|
||||
const processPlugins$ = processCommandFiles$.pipe(
|
||||
concatMap(mod => {
|
||||
if(mod.type === CommandType.Autocomplete) {
|
||||
return throwError(() => SernError.NonValidModuleType + `. You cannot use command plugins and Autocomplete.`);
|
||||
}
|
||||
const cmdPluginsRes =
|
||||
mod.plugins?.map(plug => {
|
||||
return {
|
||||
|
||||
@@ -111,6 +111,7 @@ export type ModalSubmitCommand = Override<
|
||||
export type AutocompleteCommand = Override<
|
||||
BaseModule,
|
||||
{
|
||||
name : string,
|
||||
type: CommandType.Autocomplete;
|
||||
onEvent?: EventPlugin<CommandType.Autocomplete>[];
|
||||
execute: (ctx: AutocompleteInteraction) => Awaitable<void>;
|
||||
|
||||
Reference in New Issue
Block a user