mirror of
https://github.com/sern-handler/handler
synced 2026-06-14 20:02:16 +00:00
refactor(handler) change init param to Wrapper, add eventConfig type
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type { Client } from 'discord.js';
|
||||
import type * as Sern from '../sern';
|
||||
|
||||
/**
|
||||
* An object to be passed into Sern.Handler constructor.
|
||||
@@ -14,7 +13,7 @@ interface Wrapper {
|
||||
readonly client: Client;
|
||||
readonly prefix: string;
|
||||
readonly commands: string;
|
||||
init?: (handler: Sern.Handler) => void;
|
||||
init?: (handler: Wrapper) => void;
|
||||
readonly privateServers: { test: boolean; id: string }[];
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ import type {
|
||||
CommandInteractionOptionResolver,
|
||||
MessagePayload,
|
||||
MessageOptions,
|
||||
ClientEvents,
|
||||
Awaitable,
|
||||
} from 'discord.js';
|
||||
|
||||
import type Module from '../handler/structures/module';
|
||||
@@ -21,4 +23,5 @@ export type ParseType<T> = {
|
||||
export type Arg = ParseType<{ text: string[]; slash: SlashOptions }>;
|
||||
|
||||
// TypeAlias for interaction.options
|
||||
export type eventConfig = { [K in keyof ClientEvents] : (...args : ClientEvents[K] ) => Awaitable<void>}[];
|
||||
export type SlashOptions = Omit<CommandInteractionOptionResolver, 'getMessage' | 'getFocused'>;
|
||||
|
||||
Reference in New Issue
Block a user