mirror of
https://github.com/SrIzan10/handler.git
synced 2026-05-01 10:45:17 +00:00
feat(handler) create command-options interface, remove module
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import type { possibleOutput, Arg } from '../../types/handler';
|
||||
import type { CommandType } from '../sern';
|
||||
import type Context from './context' ;
|
||||
import type { Awaitable } from 'discord.js';
|
||||
import type { Ok } from 'ts-results';
|
||||
import type * as Utils from '../utilities/preprocessors/args';
|
||||
|
||||
/**
|
||||
* An object that gets imported and acts as a command.
|
||||
* @typedef {object} Module<T=string>
|
||||
* @property {string} desc
|
||||
* @property {Visibility} visibility
|
||||
* @property {CommandType} type
|
||||
* @property {(eventParams : Context, args : Ok<T=string) => Awaitable<possibleOutput | void>)} execute
|
||||
* @prop {(ctx: Context, args: Arg) => Utils.ArgType<T>} parse
|
||||
*/
|
||||
|
||||
interface Module<T = string> {
|
||||
alias: string[];
|
||||
desc: string;
|
||||
type: CommandType;
|
||||
execute: (eventParams: Context, args: Ok<T>) => Awaitable<possibleOutput | void>;
|
||||
parse?: (ctx: Context, args: Arg) => Utils.ArgType<T>;
|
||||
}
|
||||
|
||||
export default Module;
|
||||
Reference in New Issue
Block a user