mirror of
https://github.com/sern-handler/handler
synced 2026-06-28 02:32:15 +00:00
feat(sern.ts) Add basic event manager
This commit is contained in:
@@ -14,6 +14,7 @@ export type Visibility = 'private' | 'public';
|
||||
// Anything that can be sent in a `<TextChannel>#send` or `<CommandInteraction>#reply`
|
||||
export type possibleOutput<T = string> = T | (MessagePayload & MessageOptions);
|
||||
export type execute = Module<unknown>['execute'];
|
||||
|
||||
// Thanks @cursorsdottsx
|
||||
export type ParseType<T> = {
|
||||
[K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never;
|
||||
@@ -22,6 +23,7 @@ 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 DiscordEvent =
|
||||
ParseType< { [K in keyof ClientEvents ] : (...args : ClientEvents[K]) => Awaitable<void> }>;
|
||||
|
||||
export type SlashOptions = Omit<CommandInteractionOptionResolver, 'getMessage' | 'getFocused'>;
|
||||
|
||||
Reference in New Issue
Block a user