import type { CommandInteractionOptionResolver, MessagePayload, MessageOptions, ClientEvents, Awaitable, } from 'discord.js'; import type { Module } from '../handler/structures/structxports'; // Anything that can be sent in a `#send` or `#reply` export type possibleOutput = T | (MessagePayload & MessageOptions); export type execute = Module['execute']; export type Nullish = T | undefined | null; // Thanks @cursorsdottsx export type ParseType = { [K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never; }[keyof T]; export type Args = ParseType<{ text: string[]; slash: SlashOptions }>; export type DiscordEvent = ParseType< { [K in keyof ClientEvents ] : (...args : ClientEvents[K]) => Awaitable }>; export type SlashOptions = Omit; //https://dev.to/vborodulin/ts-how-to-override-properties-with-type-intersection-554l export type Override = Omit & T2;