diff --git a/lib/Constants.ts b/lib/Constants.ts index a84c61d6..d398d739 100644 --- a/lib/Constants.ts +++ b/lib/Constants.ts @@ -45,6 +45,8 @@ export const ImageFormats = [ ] as const; export type ImageFormat = typeof ImageFormats[number]; +export type FilterFileTypes = "image" | "video" | "audio" | `.${string}`; + export enum WebhookTypes { /** Incoming webhooks can post messages to channels with a generated token */ INCOMING = 1, diff --git a/lib/types/applications.d.ts b/lib/types/applications.d.ts index f16d162a..89470bd7 100644 --- a/lib/types/applications.d.ts +++ b/lib/types/applications.d.ts @@ -36,7 +36,8 @@ import type { TeamPayoutAccountStatus, TeamPayoutGateway, TeamMemberRoleType, - ApplicationType + ApplicationType, + FilterFileTypes } from "../Constants"; import type ApplicationCommand from "../structures/ApplicationCommand"; import type ClientApplication from "../structures/ClientApplication"; @@ -283,7 +284,7 @@ export interface RawApplicationCommandOption { description: string; description_localizations?: LocaleMap | null; description_localized?: string; - file_types?: Array; + file_types?: Array; max_length?: number; max_value?: number; min_length?: number; @@ -303,7 +304,7 @@ export interface CombinedApplicationCommandOption { description: string; descriptionLocalizations?: LocaleMap | null; descriptionLocalized?: string; - fileTypes?: Array; + fileTypes?: Array; maxLength?: number; maxValue?: number; minLength?: number; @@ -394,10 +395,11 @@ interface ApplicationCommandOptionsSubCommandGroup extends ApplicationCommandOpt options?: Array; } -export interface ApplicationCommandOptionsAttachment extends ApplicationCommandOptionBase { - fileTypes?: Array; +interface ApplicationCommandOptionsFileTypeFilter { + fileTypes?: Array; } +export interface ApplicationCommandOptionsAttachment extends ApplicationCommandOptionBase, ApplicationCommandOptionsFileTypeFilter {} export interface ApplicationCommandOptionsBoolean extends ApplicationCommandOptionBase {} export interface ApplicationCommandOptionsChannel extends ApplicationCommandOptionBase, ApplicationCommandOptionsChannelTypes {} export type ApplicationCommandOptionsInteger = ApplicationCommandOptionBase & Types.Shared.ExclusifyUnion>; diff --git a/lib/types/channels.d.ts b/lib/types/channels.d.ts index 56cc5b0d..64ab98d8 100644 --- a/lib/types/channels.d.ts +++ b/lib/types/channels.d.ts @@ -36,7 +36,8 @@ import type { SeparatorSpacingSize, GuildInviteChannelTypes, DMInviteChannelTypes, - MessageReferenceType + MessageReferenceType, + FilterFileTypes } from "../Constants"; import type Member from "../structures/Member"; import type AnnouncementChannel from "../structures/AnnouncementChannel"; @@ -1648,7 +1649,7 @@ export interface RawModalLabel extends Omit { export interface ModalFileUploadComponent extends BaseComponent { customID: string; - fileTypes?: Array; + fileTypes?: Array; maxValues?: number; minValues?: number; required?: boolean; @@ -1657,7 +1658,7 @@ export interface ModalFileUploadComponent extends BaseComponent { export interface RawModalFileUploadComponent extends BaseComponent { custom_id: string; - file_types?: Array; + file_types?: Array; max_values?: number; min_values?: number; required?: boolean;