made the code pretty :)

This commit is contained in:
EvolutionX
2022-02-14 09:43:38 +05:30
parent 7545e33fa4
commit 57392f4e6a
6 changed files with 82 additions and 89 deletions

View File

@@ -5,30 +5,30 @@ import type {
CommandInteractionOptionResolver,
Message,
MessagePayload,
MessageOptions
MessageOptions,
} from 'discord.js';
import type * as Sern from '../handler/sern';
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 possibleOutput<T = string> = T | (MessagePayload & MessageOptions);
export type Nullable<T> = T | null;
export type delegate = Sern.Module<unknown>['delegate'];
// Thanks @cursorsdottsx
export type ParseType<T> = {
[K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never;
} [keyof T];
}[keyof T];
// A Sern.Module['delegate'] will carry a Context Parameter
export type Context = {
message: Option<Message>,
interaction: Option<CommandInteraction>
}
message: Option<Message>;
interaction: Option<CommandInteraction>;
};
export type Arg = ParseType<{ text: string; slash: SlashOptions }>;
export type Arg = ParseType<{ text: string, slash: SlashOptions }>;
// TypeAlias for interaction.options
export type SlashOptions = Omit<CommandInteractionOptionResolver, 'getMessage' | 'getFocused'>;