import type { RawFile } from '../../api'; import type { Attachment, AttachmentBuilder, Embed, Modal, PollBuilder, TopLevelBuilders } from '../../builders'; import type { InMessageEmbed } from '../../structures/Message'; import type { APIEmbed, APIInteractionResponseCallbackData, APIInteractionResponseChannelMessageWithSource, APIModalInteractionResponse, MessageFlags, RESTAPIPollCreate, RESTPatchAPIChannelMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIChannelThreadsJSONBody, RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIWebhookWithTokenJSONBody } from '../../types'; import type { OmitInsert, RequireAtLeastOne } from './util'; export interface ResolverProps { content?: string | undefined | null; embeds?: (Embed | APIEmbed | InMessageEmbed)[] | undefined; components?: TopLevelBuilders[] | ReturnType[]; files?: AttachmentBuilder[] | Attachment[] | RawFile[] | undefined; } export interface SendResolverProps extends ResolverProps { poll?: PollBuilder | RESTAPIPollCreate | undefined; } export type MessageCreateBodyRequest = OmitInsert; export type MessageUpdateBodyRequest = OmitInsert; export type MessageWebhookCreateBodyRequest = OmitInsert; export type MessageWebhookUpdateBodyRequest = OmitInsert; export type InteractionMessageUpdateBodyRequest = OmitInsert & { flags?: MessageFlags; }; export type ComponentInteractionMessageUpdate = OmitInsert; export type InteractionCreateBodyRequest = OmitInsert; export type ModalCreateBodyRequest = APIModalInteractionResponse['data'] | Modal; export interface ModalCreateOptions { waitFor?: number; } /** * Force at least one of the following properties must be provided: any content of `message` or `files`. */ export type ThreadOnlyCreateBodyRequest = RequireAtLeastOne, 'sticker_ids' | 'content' | 'embeds' | 'components'>; files?: ResolverProps['files']; name: string; }>, 'message' | 'files'>; export type ThreadCreateBodyRequest = ThreadOnlyCreateBodyRequest | RESTPostAPIChannelThreadsJSONBody;