all repos — kitten @ b219fb2f774165981101cc0bf3ba30e9fd84fa65

types: generate into separate files
vi did:web:vt3e.cat
Fri, 19 Jun 2026 05:17:59 +0100
commit

b219fb2f774165981101cc0bf3ba30e9fd84fa65

parent

df5d61dd2bc1bd8a2caa0321c06671ae5e84383b

4 files changed, 89 insertions(+), 6022 deletions(-)

jump to
D pkgs/types/discord-api-types.ts

@@ -1,5993 +0,0 @@

-// this file is auto-generated. don;t edit it manually. -// TODO)) separate snowflakes for users, guilds, channels, etc -export type Snowflake = string; - -export interface AccountResponse { - id: string; - name: (string | null); -} - -export interface ActionRowComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - components: Array<(ButtonComponentForMessageRequest | ChannelSelectComponentForMessageRequest | MentionableSelectComponentForMessageRequest | RoleSelectComponentForMessageRequest | StringSelectComponentForMessageRequest | UserSelectComponentForMessageRequest)>; -} - -export interface ActionRowComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - components: Array<TextInputComponentForModalRequest>; -} - -export interface ActionRowComponentResponse { - type: (MessageComponentTypes); - id: number; - components: Array<(ButtonComponentResponse | ChannelSelectComponentResponse | MentionableSelectComponentResponse | RoleSelectComponentResponse | StringSelectComponentResponse | TextInputComponentResponse | UserSelectComponentResponse)>; -} - -export type ActionTypes = ('TYPING_START' | 'INVITE_CREATE' | 'INVITE_DELETE' | 'WEBHOOKS_UPDATE' | 'CHANNEL_CREATE' | 'VOICE_CHANNEL_STATUS_UPDATE' | 'CHANNEL_UPDATE' | 'CHANNEL_DELETE' | 'CHANNEL_PINS_UPDATE' | 'THREAD_CREATE' | 'THREAD_UPDATE' | 'THREAD_DELETE' | 'THREAD_LIST_SYNC' | 'THREAD_MEMBER_UPDATE' | 'THREAD_MEMBERS_UPDATE' | 'GUILD_CREATE' | 'GUILD_UPDATE' | 'GUILD_DELETE' | 'GUILD_EMOJIS_UPDATE' | 'GUILD_STICKERS_UPDATE' | 'GUILD_INTEGRATIONS_UPDATE' | 'GUILD_MEMBER_ADD' | 'GUILD_MEMBER_UPDATE' | 'GUILD_MEMBER_REMOVE' | 'GUILD_BAN_ADD' | 'GUILD_BAN_REMOVE' | 'GUILD_ROLE_CREATE' | 'GUILD_ROLE_UPDATE' | 'GUILD_ROLE_DELETE' | 'GUILD_MEMBERS_CHUNK' | 'MESSAGE_CREATE' | 'MESSAGE_UPDATE' | 'MESSAGE_DELETE' | 'MESSAGE_DELETE_BULK' | 'MESSAGE_REACTION_ADD' | 'MESSAGE_REACTION_REMOVE' | 'MESSAGE_REACTION_REMOVE_ALL' | 'MESSAGE_REACTION_REMOVE_EMOJI' | 'USER_UPDATE' | 'ENTITLEMENT_CREATE' | 'ENTITLEMENT_UPDATE' | 'ENTITLEMENT_DELETE' | 'READY' | 'RESUMED' | 'PRESENCE_UPDATE' | 'VOICE_STATE_UPDATE' | 'VOICE_SERVER_UPDATE' | 'LOBBY_MESSAGE_CREATE' | 'LOBBY_MESSAGE_UPDATE' | 'LOBBY_MESSAGE_DELETE' | 'GAME_DIRECT_MESSAGE_CREATE' | 'GAME_DIRECT_MESSAGE_DELETE' | 'GAME_DIRECT_MESSAGE_UPDATE' | 'INTERACTION_CREATE' | 'INTEGRATION_CREATE' | 'INTEGRATION_UPDATE' | 'INTEGRATION_DELETE' | 'APPLICATION_COMMAND_PERMISSIONS_UPDATE' | 'APPLICATION_AUTHORIZED' | 'APPLICATION_DEAUTHORIZED' | 'STAGE_INSTANCE_CREATE' | 'STAGE_INSTANCE_UPDATE' | 'STAGE_INSTANCE_DELETE' | 'GUILD_AUDIT_LOG_ENTRY_CREATE' | 'GUILD_SCHEDULED_EVENT_CREATE' | 'GUILD_SCHEDULED_EVENT_UPDATE' | 'GUILD_SCHEDULED_EVENT_DELETE' | 'GUILD_SCHEDULED_EVENT_USER_ADD' | 'GUILD_SCHEDULED_EVENT_USER_REMOVE' | 'AUTO_MODERATION_RULE_CREATE' | 'AUTO_MODERATION_RULE_UPDATE' | 'AUTO_MODERATION_RULE_DELETE' | 'AUTO_MODERATION_ACTION_EXECUTION' | 'GUILD_SOUNDBOARD_SOUNDS_UPDATE' | 'GUILD_SOUNDBOARD_SOUND_CREATE' | 'GUILD_SOUNDBOARD_SOUND_UPDATE' | 'GUILD_SOUNDBOARD_SOUND_DELETE' | 'QUEST_USER_ENROLLMENT' | 'RATE_LIMITED'); - -export interface ActivitiesAttachmentResponse { - attachment: AttachmentResponse; -} - -export type ActivityActionTypes = (1 | 2 | 3 | 5 | 6); - -export interface ActivityInstanceCallbackResponse { - id: string; -} - -export type AfkTimeouts = (60 | 300 | 900 | 1800 | 3600); - -export type AllowedMentionTypes = ('users' | 'roles' | 'everyone'); - -export interface ApplicationCommandAttachmentOption { - type: (ApplicationCommandOptionType); - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: (boolean | null); -} - -export interface ApplicationCommandAttachmentOptionResponse { - type: (ApplicationCommandOptionType); - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localized?: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: boolean; -} - -export interface ApplicationCommandAutocompleteCallbackRequest { - type: (InteractionCallbackTypes); - data: (InteractionApplicationCommandAutocompleteCallbackIntegerData | InteractionApplicationCommandAutocompleteCallbackNumberData | InteractionApplicationCommandAutocompleteCallbackStringData); -} - -export interface ApplicationCommandBooleanOption { - type: (ApplicationCommandOptionType); - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: (boolean | null); -} - -export interface ApplicationCommandBooleanOptionResponse { - type: (ApplicationCommandOptionType); - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localized?: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: boolean; -} - -export interface ApplicationCommandChannelOption { - type: (ApplicationCommandOptionType); - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: (boolean | null); - channel_types?: (Array<ChannelTypes> | null); -} - -export interface ApplicationCommandChannelOptionResponse { - type: (ApplicationCommandOptionType); - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localized?: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: boolean; - channel_types?: Array<ChannelTypes>; -} - -export interface ApplicationCommandCreateRequest { - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description?: (string | null); - description_localizations?: ({ - [key: string]: string; -} | null); - options?: (Array<(ApplicationCommandAttachmentOption | ApplicationCommandBooleanOption | ApplicationCommandChannelOption | ApplicationCommandIntegerOption | ApplicationCommandMentionableOption | ApplicationCommandNumberOption | ApplicationCommandRoleOption | ApplicationCommandStringOption | ApplicationCommandSubcommandGroupOption | ApplicationCommandSubcommandOption | ApplicationCommandUserOption)> | null); - default_member_permissions?: (number | null); - dm_permission?: (boolean | null); - contexts?: (Array<InteractionContextType> | null); - integration_types?: (Array<ApplicationIntegrationType> | null); - handler?: (null | ApplicationCommandHandler); - type?: (null | ApplicationCommandType); -} - -export type ApplicationCommandHandler = (1 | 2); - -export interface ApplicationCommandIntegerOption { - type: (ApplicationCommandOptionType); - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: (boolean | null); - autocomplete?: (boolean | null); - choices?: (Array<ApplicationCommandOptionIntegerChoice> | null); - min_value?: (null | Int53Type); - max_value?: (null | Int53Type); -} - -export interface ApplicationCommandIntegerOptionResponse { - type: (ApplicationCommandOptionType); - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localized?: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: boolean; - autocomplete?: boolean; - choices?: Array<ApplicationCommandOptionIntegerChoiceResponse>; - min_value?: Int53Type; - max_value?: Int53Type; -} - -export interface ApplicationCommandInteractionMetadataResponse { - id: Snowflake; - type: (InteractionTypes); - user?: UserResponse; - authorizing_integration_owners: { - [key: string]: Snowflake; -}; - original_response_message_id?: Snowflake; - target_user?: UserResponse; - target_message_id?: Snowflake; -} - -export interface ApplicationCommandMentionableOption { - type: (ApplicationCommandOptionType); - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: (boolean | null); -} - -export interface ApplicationCommandMentionableOptionResponse { - type: (ApplicationCommandOptionType); - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localized?: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: boolean; -} - -export interface ApplicationCommandNumberOption { - type: (ApplicationCommandOptionType); - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: (boolean | null); - autocomplete?: (boolean | null); - choices?: (Array<ApplicationCommandOptionNumberChoice> | null); - min_value?: (number | null); - max_value?: (number | null); -} - -export interface ApplicationCommandNumberOptionResponse { - type: (ApplicationCommandOptionType); - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localized?: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: boolean; - autocomplete?: boolean; - choices?: Array<ApplicationCommandOptionNumberChoiceResponse>; - min_value?: number; - max_value?: number; -} - -export interface ApplicationCommandOptionIntegerChoice { - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - value: Int53Type; -} - -export interface ApplicationCommandOptionIntegerChoiceResponse { - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - value: Int53Type; -} - -export interface ApplicationCommandOptionNumberChoice { - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - value: number; -} - -export interface ApplicationCommandOptionNumberChoiceResponse { - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - value: number; -} - -export interface ApplicationCommandOptionStringChoice { - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - value: string; -} - -export interface ApplicationCommandOptionStringChoiceResponse { - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - value: string; -} - -export type ApplicationCommandOptionType = (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11); - -export interface ApplicationCommandPatchRequestPartial { - name?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description?: (string | null); - description_localizations?: ({ - [key: string]: string; -} | null); - options?: (Array<(ApplicationCommandAttachmentOption | ApplicationCommandBooleanOption | ApplicationCommandChannelOption | ApplicationCommandIntegerOption | ApplicationCommandMentionableOption | ApplicationCommandNumberOption | ApplicationCommandRoleOption | ApplicationCommandStringOption | ApplicationCommandSubcommandGroupOption | ApplicationCommandSubcommandOption | ApplicationCommandUserOption)> | null); - default_member_permissions?: (number | null); - dm_permission?: (boolean | null); - contexts?: (Array<InteractionContextType> | null); - integration_types?: (Array<ApplicationIntegrationType> | null); - handler?: (null | ApplicationCommandHandler); -} - -export interface ApplicationCommandPermission { - id: Snowflake; - type: ApplicationCommandPermissionType; - permission: boolean; -} - -export type ApplicationCommandPermissionType = (1 | 2 | 3); - -export interface ApplicationCommandResponse { - id: Snowflake; - application_id: Snowflake; - version: Snowflake; - default_member_permissions: (string | null); - type: ApplicationCommandType; - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localized?: string; - description_localizations?: ({ - [key: string]: string; -} | null); - guild_id?: Snowflake; - dm_permission?: boolean; - contexts?: (Array<InteractionContextType> | null); - integration_types?: Array<ApplicationIntegrationType>; - options?: Array<(ApplicationCommandAttachmentOptionResponse | ApplicationCommandBooleanOptionResponse | ApplicationCommandChannelOptionResponse | ApplicationCommandIntegerOptionResponse | ApplicationCommandMentionableOptionResponse | ApplicationCommandNumberOptionResponse | ApplicationCommandRoleOptionResponse | ApplicationCommandStringOptionResponse | ApplicationCommandSubcommandGroupOptionResponse | ApplicationCommandSubcommandOptionResponse | ApplicationCommandUserOptionResponse)>; - nsfw?: boolean; - handler?: ApplicationCommandHandler; -} - -export interface ApplicationCommandRoleOption { - type: (ApplicationCommandOptionType); - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: (boolean | null); -} - -export interface ApplicationCommandRoleOptionResponse { - type: (ApplicationCommandOptionType); - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localized?: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: boolean; -} - -export interface ApplicationCommandStringOption { - type: (ApplicationCommandOptionType); - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: (boolean | null); - autocomplete?: (boolean | null); - min_length?: (number | null); - max_length?: (number | null); - choices?: (Array<ApplicationCommandOptionStringChoice> | null); -} - -export interface ApplicationCommandStringOptionResponse { - type: (ApplicationCommandOptionType); - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localized?: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: boolean; - autocomplete?: boolean; - choices?: Array<ApplicationCommandOptionStringChoiceResponse>; - min_length?: number; - max_length?: number; -} - -export interface ApplicationCommandSubcommandGroupOption { - type: (ApplicationCommandOptionType); - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: (boolean | null); - options?: (Array<ApplicationCommandSubcommandOption> | null); -} - -export interface ApplicationCommandSubcommandGroupOptionResponse { - type: (ApplicationCommandOptionType); - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localized?: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: boolean; - options?: Array<ApplicationCommandSubcommandOptionResponse>; -} - -export interface ApplicationCommandSubcommandOption { - type: (ApplicationCommandOptionType); - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: (boolean | null); - options?: (Array<(ApplicationCommandAttachmentOption | ApplicationCommandBooleanOption | ApplicationCommandChannelOption | ApplicationCommandIntegerOption | ApplicationCommandMentionableOption | ApplicationCommandNumberOption | ApplicationCommandRoleOption | ApplicationCommandStringOption | ApplicationCommandUserOption)> | null); -} - -export interface ApplicationCommandSubcommandOptionResponse { - type: (ApplicationCommandOptionType); - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localized?: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: boolean; - options?: Array<(ApplicationCommandAttachmentOptionResponse | ApplicationCommandBooleanOptionResponse | ApplicationCommandChannelOptionResponse | ApplicationCommandIntegerOptionResponse | ApplicationCommandMentionableOptionResponse | ApplicationCommandNumberOptionResponse | ApplicationCommandRoleOptionResponse | ApplicationCommandStringOptionResponse | ApplicationCommandUserOptionResponse)>; -} - -export type ApplicationCommandType = (1 | 2 | 3 | 4); - -export interface ApplicationCommandUpdateRequest { - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description?: (string | null); - description_localizations?: ({ - [key: string]: string; -} | null); - options?: (Array<(ApplicationCommandAttachmentOption | ApplicationCommandBooleanOption | ApplicationCommandChannelOption | ApplicationCommandIntegerOption | ApplicationCommandMentionableOption | ApplicationCommandNumberOption | ApplicationCommandRoleOption | ApplicationCommandStringOption | ApplicationCommandSubcommandGroupOption | ApplicationCommandSubcommandOption | ApplicationCommandUserOption)> | null); - default_member_permissions?: (number | null); - dm_permission?: (boolean | null); - contexts?: (Array<InteractionContextType> | null); - integration_types?: (Array<ApplicationIntegrationType> | null); - handler?: (null | ApplicationCommandHandler); - type?: (null | ApplicationCommandType); - id?: (null | Snowflake); -} - -export interface ApplicationCommandUserOption { - type: (ApplicationCommandOptionType); - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: (boolean | null); -} - -export interface ApplicationCommandUserOptionResponse { - type: (ApplicationCommandOptionType); - name: string; - name_localized?: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localized?: string; - description_localizations?: ({ - [key: string]: string; -} | null); - required?: boolean; -} - -export type ApplicationEventWebhooksStatus = (1 | 2 | 3); - -export type ApplicationExplicitContentFilterTypes = (0 | 1); - -export interface ApplicationFormPartial { - description?: ({ - default: string; - localizations?: ({ - [key: string]: string; -} | null); -} | null); - icon?: (string | null); - cover_image?: (string | null); - team_id?: (null | Snowflake); - flags?: (number | null); - interactions_endpoint_url?: (string | null); - explicit_content_filter?: (null | ApplicationExplicitContentFilterTypes); - max_participants?: (number | null); - type?: (null | ApplicationTypes); - tags?: (Array<string> | null); - custom_install_url?: (string | null); - install_params?: (null | ApplicationOAuth2InstallParams); - role_connections_verification_url?: (string | null); - integration_types_config?: ({ - [key: string]: (null | ApplicationIntegrationTypeConfiguration); -} | null); - event_webhooks_status?: (null | (ApplicationEventWebhooksStatus)); - event_webhooks_url?: (string | null); - event_webhooks_types?: (Array<(ActionTypes)> | null); -} - -export type ApplicationIdentityProviderAuthType = ('OIDC' | 'EPIC_ONLINE_SERVICES_ACCESS_TOKEN' | 'EPIC_ONLINE_SERVICES_ID_TOKEN' | 'STEAM_SESSION_TICKET' | 'UNITY_SERVICES_ID_TOKEN' | 'DISCORD_BOT_ISSUED_ACCESS_TOKEN' | 'APPLE_ID_TOKEN' | 'PLAYSTATION_NETWORK_ID_TOKEN'); - -export interface ApplicationIncomingWebhookResponse { - application_id: (null | Snowflake); - avatar: (string | null); - channel_id: (null | Snowflake); - guild_id?: (null | Snowflake); - id: Snowflake; - name: string; - type: (WebhookTypes); - user?: UserResponse; -} - -export type ApplicationIntegrationType = (0 | 1); - -export interface ApplicationIntegrationTypeConfiguration { - oauth2_install_params?: (null | ApplicationOAuth2InstallParams); -} - -export interface ApplicationIntegrationTypeConfigurationResponse { - oauth2_install_params?: ApplicationOAuth2InstallParamsResponse; -} - -export interface ApplicationOAuth2InstallParams { - scopes?: (Array<(OAuth2Scopes)> | null); - permissions?: (number | null); -} - -export interface ApplicationOAuth2InstallParamsResponse { - scopes: Array<(OAuth2Scopes)>; - permissions: string; -} - -export interface ApplicationResponse { - id: Snowflake; - name: string; - icon: (string | null); - description: string; - type: (null | ApplicationTypes); - cover_image?: string; - primary_sku_id?: Snowflake; - bot?: UserResponse; - slug?: string; - guild_id?: Snowflake; - rpc_origins?: Array<string>; - bot_public?: boolean; - bot_require_code_grant?: boolean; - terms_of_service_url?: string; - privacy_policy_url?: string; - custom_install_url?: string; - install_params?: ApplicationOAuth2InstallParamsResponse; - integration_types_config?: { - [key: string]: ApplicationIntegrationTypeConfigurationResponse; -}; - verify_key: string; - flags: number; - flags_new: string; - max_participants?: (number | null); - tags?: Array<string>; -} - -export interface ApplicationRoleConnectionsMetadataItemRequest { - type: MetadataItemTypes; - key: string; - name: string; - name_localizations?: ({ - [key: string]: (string | null); -} | null); - description: string; - description_localizations?: ({ - [key: string]: (string | null); -} | null); -} - -export interface ApplicationRoleConnectionsMetadataItemResponse { - type: MetadataItemTypes; - key: string; - name: string; - name_localizations?: ({ - [key: string]: string; -} | null); - description: string; - description_localizations?: ({ - [key: string]: string; -} | null); -} - -export type ApplicationTypes = (4); - -export interface ApplicationUserRoleConnectionResponse { - platform_name?: string; - platform_username?: (string | null); - metadata?: { - [key: string]: string; -}; -} - -export interface AttachmentResponse { - id: Snowflake; - filename: string; - size: number; - url: string; - proxy_url: string; - width?: number; - height?: number; - duration_secs?: number; - waveform?: string; - description?: string; - content_type?: string; - ephemeral?: boolean; - flags?: number; - placeholder?: string; - placeholder_version?: number; - title?: (string | null); - application?: ApplicationResponse; - clip_created_at?: string; - clip_participants?: Array<UserResponse>; -} - -export type AuditLogActionTypes = (1 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 31 | 32 | 40 | 41 | 42 | 50 | 51 | 52 | 60 | 61 | 62 | 72 | 73 | 74 | 75 | 80 | 81 | 82 | 83 | 84 | 85 | 90 | 91 | 92 | 100 | 101 | 102 | 110 | 111 | 112 | 121 | 130 | 131 | 132 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 150 | 151 | 163 | 164 | 165 | 166 | 167 | 171 | 172 | 180 | 190 | 191 | 192 | 193 | 200 | 201 | 202 | 211); - -export interface AuditLogEntryResponse { - id: Snowflake; - action_type: AuditLogActionTypes; - user_id: (null | Snowflake); - target_id: (null | Snowflake); - changes?: Array<AuditLogObjectChangeResponse>; - options?: { - [key: string]: string; -}; - reason?: string; -} - -export interface AuditLogObjectChangeResponse { - key: (string | null); - new_value?: any; - old_value?: any; -} - -export type AuthorType = ('user' | 'bot' | 'webhook' | '-user' | '-bot' | '-webhook'); - -export type AutomodActionType = (1 | 2 | 3 | 4); - -export type AutomodEventType = (1 | 2); - -export type AutomodKeywordPresetType = (1 | 2 | 3); - -export type AutomodTriggerType = (1 | 3 | 4 | 5 | 6); - -export type AvailableLocalesEnum = ('ar' | 'bg' | 'cs' | 'da' | 'de' | 'el' | 'en-GB' | 'en-US' | 'es-419' | 'es-ES' | 'fi' | 'fr' | 'he' | 'hi' | 'hr' | 'hu' | 'id' | 'it' | 'ja' | 'ko' | 'lt' | 'nl' | 'no' | 'pl' | 'pt-BR' | 'ro' | 'ru' | 'sv-SE' | 'th' | 'tr' | 'uk' | 'vi' | 'zh-CN' | 'zh-TW'); - -export interface BanUserFromGuildRequest { - delete_message_seconds?: (number | null); - delete_message_days?: (number | null); -} - -export interface BaseCreateMessageCreateRequest { - content?: (string | null); - embeds?: (Array<RichEmbed> | null); - allowed_mentions?: (null | MessageAllowedMentionsRequest); - sticker_ids?: (Array<Snowflake> | null); - components?: (Array<(ActionRowComponentForMessageRequest | ContainerComponentForMessageRequest | FileComponentForMessageRequest | MediaGalleryComponentForMessageRequest | SectionComponentForMessageRequest | SeparatorComponentForMessageRequest | TextDisplayComponentForMessageRequest)> | null); - flags?: (number | null); - attachments?: (Array<MessageAttachmentRequest> | null); - poll?: (null | PollCreateRequest); - shared_client_theme?: (null | CustomClientThemeShareRequest); -} - -export interface BasicApplicationResponseWithBot { - id: Snowflake; - name: string; - icon: (string | null); - description: string; - type: (null | ApplicationTypes); - cover_image?: string; - primary_sku_id?: Snowflake; - bot?: UserResponse; -} - -export interface BasicGuildMemberResponse { - avatar: (string | null); - avatar_decoration_data?: (null | UserAvatarDecorationResponse); - banner: (string | null); - communication_disabled_until: (string | null); - flags: number; - joined_at: string; - nick: (string | null); - pending: boolean; - premium_since: (string | null); - roles: Array<Snowflake>; - collectibles?: (null | UserCollectiblesResponse); -} - -export interface BasicMessageResponse { - type: MessageType; - content: string; - mentions: Array<UserResponse>; - mention_roles: Array<Snowflake>; - attachments: Array<MessageAttachmentResponse>; - embeds: Array<MessageEmbedResponse>; - timestamp: string; - edited_timestamp: (string | null); - flags: number; - components: Array<(ActionRowComponentResponse | ContainerComponentResponse | FileComponentResponse | MediaGalleryComponentResponse | SectionComponentResponse | SeparatorComponentResponse | TextDisplayComponentResponse)>; - stickers?: Array<(GuildStickerResponse | StandardStickerResponse)>; - sticker_items?: Array<MessageStickerItemResponse>; - id: Snowflake; - channel_id: Snowflake; - author: UserResponse; - pinned: boolean; - mention_everyone: boolean; - tts: boolean; - call?: MessageCallResponse; - activity?: MessageActivityResponse; - application?: BasicApplicationResponseWithBot; - application_id?: Snowflake; - interaction?: MessageInteractionResponse; - nonce?: (number | string); - webhook_id?: Snowflake; - message_reference?: MessageReferenceResponse; - thread?: ThreadResponse; - mention_channels?: Array<MessageMentionChannelResponse>; - role_subscription_data?: MessageRoleSubscriptionDataResponse; - purchase_notification?: PurchaseNotificationResponse; - position?: number; - resolved?: ResolvedObjectsResponse; - poll?: PollResponse; - shared_client_theme?: CustomClientThemeResponse; - interaction_metadata?: (ApplicationCommandInteractionMetadataResponse | MessageComponentInteractionMetadataResponse | ModalSubmitInteractionMetadataResponse); - message_snapshots?: Array<MessageSnapshotResponse>; -} - -export interface BlockMessageAction { - type: (AutomodActionType); - metadata?: (null | BlockMessageActionMetadata); -} - -export interface BlockMessageActionMetadata { - custom_message?: (string | null); -} - -export interface BlockMessageActionMetadataResponse { - custom_message?: string; -} - -export interface BlockMessageActionResponse { - type: (AutomodActionType); - metadata: BlockMessageActionMetadataResponse; -} - -export interface BotAccountPatchRequest { - username: string; - avatar?: (string | null); - banner?: (string | null); -} - -export interface BotAddGuildMemberRequest { - nick?: (string | null); - roles?: (Array<Snowflake> | null); - mute?: (boolean | null); - deaf?: (boolean | null); - access_token: string; - flags?: (number | null); -} - -export interface BulkBanUsersRequest { - user_ids: Array<Snowflake>; - delete_message_seconds?: (number | null); -} - -export interface BulkBanUsersResponse { - banned_users: Array<Snowflake>; - failed_users: Array<Snowflake>; -} - -export interface BulkLobbyMemberRequest { - id: Snowflake; - metadata?: ({ - [key: string]: string; -} | null); - flags?: (null | 1); - remove_member?: (boolean | null); -} - -export interface ButtonComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id?: (string | null); - style: ButtonStyleTypes; - label?: (string | null); - disabled?: (boolean | null); - url?: (string | null); - sku_id?: (null | Snowflake); - emoji?: (null | ComponentEmojiForRequest); -} - -export interface ButtonComponentResponse { - type: (MessageComponentTypes); - id: number; - custom_id?: string; - style: ButtonStyleTypes; - label?: string; - disabled?: boolean; - emoji?: ComponentEmojiResponse; - url?: (string | null); - sku_id?: Snowflake; -} - -export type ButtonStyleTypes = (1 | 2 | 3 | 4 | 5 | 6); - -export interface ByNWeekday { - n: number; - day: RecurrenceRuleWeekdays; -} - -export interface ByNWeekdayResponse { - n: number; - day: RecurrenceRuleWeekdays; -} - -export interface ChannelFollowerResponse { - channel_id: Snowflake; - webhook_id: Snowflake; -} - -export interface ChannelFollowerWebhookResponse { - application_id: (null | Snowflake); - avatar: (string | null); - channel_id: (null | Snowflake); - guild_id?: (null | Snowflake); - id: Snowflake; - name: string; - type: (WebhookTypes); - user?: UserResponse; - source_guild?: WebhookSourceGuildResponse; - source_channel?: WebhookSourceChannelResponse; -} - -export interface ChannelPermissionOverwriteRequest { - id: Snowflake; - type?: (null | ChannelPermissionOverwrites); - allow?: (number | null); - deny?: (number | null); -} - -export interface ChannelPermissionOverwriteResponse { - id: Snowflake; - type: ChannelPermissionOverwrites; - allow: string; - deny: string; -} - -export type ChannelPermissionOverwrites = (0 | 1); - -export interface ChannelSelectComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - placeholder?: (string | null); - min_values?: (number | null); - max_values?: (number | null); - disabled?: (boolean | null); - required?: (boolean | null); - default_values?: (Array<ChannelSelectDefaultValue> | null); - channel_types?: (Array<ChannelTypes> | null); -} - -export interface ChannelSelectComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - placeholder?: (string | null); - min_values?: (number | null); - max_values?: (number | null); - disabled?: (boolean | null); - required?: (boolean | null); - default_values?: (Array<ChannelSelectDefaultValue> | null); - channel_types?: (Array<ChannelTypes> | null); -} - -export interface ChannelSelectComponentResponse { - type: (MessageComponentTypes); - id: number; - custom_id: string; - placeholder?: string; - min_values: number; - max_values: number; - disabled?: boolean; - channel_types?: Array<ChannelTypes>; - default_values?: Array<ChannelSelectDefaultValueResponse>; -} - -export interface ChannelSelectDefaultValue { - type: (Snowflake); - id: Snowflake; -} - -export interface ChannelSelectDefaultValueResponse { - type: (Snowflake); - id: Snowflake; -} - -export type ChannelTypes = (1 | 3 | 0 | 2 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 15); - -export interface CheckboxComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - default?: (boolean | null); -} - -export interface CheckboxGroupComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - min_values?: (number | null); - max_values?: (number | null); - required?: (boolean | null); - options: Array<CheckboxGroupOptionForRequest>; -} - -export interface CheckboxGroupOptionForRequest { - label: string; - value: string; - description?: (string | null); - default?: (boolean | null); -} - -export interface CommandPermissionResponse { - id: Snowflake; - type: ApplicationCommandPermissionType; - permission: boolean; -} - -export interface CommandPermissionsResponse { - id: Snowflake; - application_id: Snowflake; - guild_id: Snowflake; - permissions: Array<CommandPermissionResponse>; -} - -export interface ComponentEmojiForRequest { - id?: (null | Snowflake); - name: string; -} - -export interface ComponentEmojiResponse { - id?: Snowflake; - name: string; - animated?: boolean; -} - -export interface ConnectedAccountGuildResponse { - id: Snowflake; - name: string; - icon: (string | null); -} - -export interface ConnectedAccountIntegrationResponse { - id: string; - type: IntegrationTypes; - account: AccountResponse; - guild: ConnectedAccountGuildResponse; -} - -export type ConnectedAccountProviders = ('battlenet' | 'bluesky' | 'bungie' | 'ebay' | 'epicgames' | 'facebook' | 'github' | 'instagram' | 'mastodon' | 'leagueoflegends' | 'paypal' | 'playstation' | 'reddit' | 'riotgames' | 'roblox' | 'skype' | 'spotify' | 'steam' | 'tiktok' | 'twitch' | 'twitter' | 'xbox' | 'youtube' | 'domain'); - -export interface ConnectedAccountResponse { - id: string; - name: (string | null); - type: ConnectedAccountProviders; - friend_sync: boolean; - integrations?: Array<ConnectedAccountIntegrationResponse>; - show_activity: boolean; - two_way_link: boolean; - verified: boolean; - visibility: ConnectedAccountVisibility; - revoked?: boolean; -} - -export type ConnectedAccountVisibility = (0 | 1); - -export interface ContainerComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - accent_color?: (number | null); - components: Array<(ActionRowComponentForMessageRequest | FileComponentForMessageRequest | MediaGalleryComponentForMessageRequest | SectionComponentForMessageRequest | SeparatorComponentForMessageRequest | TextDisplayComponentForMessageRequest)>; - spoiler?: (boolean | null); -} - -export interface ContainerComponentResponse { - type: (MessageComponentTypes); - id: number; - accent_color: (number | null); - components: Array<(ActionRowComponentResponse | FileComponentResponse | MediaGalleryComponentResponse | SectionComponentResponse | SeparatorComponentResponse | TextDisplayComponentResponse)>; - spoiler: boolean; -} - -export interface CreateEntitlementRequestData { - sku_id: Snowflake; - owner_id: Snowflake; - owner_type: EntitlementOwnerTypes; -} - -export interface CreateForumThreadRequest { - name: string; - auto_archive_duration?: (null | ThreadAutoArchiveDuration); - rate_limit_per_user?: (number | null); - applied_tags?: (Array<Snowflake> | null); - message: BaseCreateMessageCreateRequest; -} - -export interface CreateGroupDMInviteRequest { - max_age?: (number | null); -} - -export interface CreateGuildChannelRequest { - type?: (null | (ChannelTypes)); - name: string; - position?: (number | null); - topic?: (string | null); - bitrate?: (number | null); - user_limit?: (number | null); - nsfw?: (boolean | null); - rate_limit_per_user?: (number | null); - parent_id?: (null | Snowflake); - permission_overwrites?: (Array<ChannelPermissionOverwriteRequest> | null); - rtc_region?: (string | null); - video_quality_mode?: (null | VideoQualityModes); - default_auto_archive_duration?: (null | ThreadAutoArchiveDuration); - default_reaction_emoji?: (null | UpdateDefaultReactionEmojiRequest); - default_thread_rate_limit_per_user?: (number | null); - default_sort_order?: (null | ThreadSortOrder); - default_forum_layout?: (null | ForumLayout); - default_tag_setting?: (null | ThreadSearchTagSetting); - available_tags?: (Array<(null | CreateOrUpdateThreadTagRequest)> | null); -} - -export interface CreateGuildInviteRequest { - max_age?: (number | null); - temporary?: (boolean | null); - max_uses?: (number | null); - unique?: (boolean | null); - target_user_id?: (null | Snowflake); - target_application_id?: (null | Snowflake); - target_type?: (null | (InviteTargetTypes)); - role_ids?: (string | Array<Snowflake> | null); -} - -export interface CreateMessageInteractionCallbackRequest { - type: (InteractionCallbackTypes); - data?: (null | IncomingWebhookInteractionRequest); -} - -export interface CreateMessageInteractionCallbackResponse { - type: (InteractionCallbackTypes); - message: MessageResponse; -} - -export interface CreateOrUpdateThreadTagRequest { - name: string; - emoji_id?: (null | Snowflake); - emoji_name?: (string | null); - moderated?: (boolean | null); -} - -export interface CreatePrivateChannelRequest { - recipient_id?: (null | Snowflake); - access_tokens?: (Array<string> | null); - nicks?: ({ - [key: string]: (string | null); -} | null); -} - -export interface CreateRoleRequest { - name?: (string | null); - permissions?: (number | null); - color?: (number | null); - colors?: (null | RoleColors); - hoist?: (boolean | null); - mentionable?: (boolean | null); - icon?: (string | null); - unicode_emoji?: (string | null); -} - -export interface CreateTextThreadWithMessageRequest { - name: string; - auto_archive_duration?: (null | ThreadAutoArchiveDuration); - rate_limit_per_user?: (number | null); -} - -export interface CreateTextThreadWithoutMessageRequest { - name: string; - auto_archive_duration?: (null | ThreadAutoArchiveDuration); - rate_limit_per_user?: (number | null); - type?: (null | (ChannelTypes)); - invitable?: (boolean | null); -} - -export interface CreatedThreadResponse { - id: Snowflake; - type: (ChannelTypes); - last_message_id?: (null | Snowflake); - flags: number; - last_pin_timestamp?: (string | null); - guild_id: Snowflake; - name: string; - parent_id?: (null | Snowflake); - rate_limit_per_user?: number; - bitrate?: number; - user_limit?: number; - rtc_region?: (string | null); - video_quality_mode?: VideoQualityModes; - permissions?: string; - owner_id: Snowflake; - thread_metadata: ThreadMetadataResponse; - message_count: number; - member_count: number; - total_message_sent: number; - applied_tags?: Array<Snowflake>; - member?: ThreadMemberResponse; -} - -export interface CustomClientThemeResponse { - colors: Array<string>; - gradient_angle: number; - base_mix: number; - base_theme: MessageShareCustomUserThemeBaseTheme; -} - -export interface CustomClientThemeShareRequest { - colors: Array<string>; - gradient_angle: number; - base_mix: number; - base_theme?: (null | MessageShareCustomUserThemeBaseTheme); -} - -export interface DefaultKeywordListTriggerMetadata { - allow_list?: (Array<string> | null); - presets?: (Array<AutomodKeywordPresetType> | null); -} - -export interface DefaultKeywordListTriggerMetadataResponse { - allow_list: Array<string>; - presets: Array<AutomodKeywordPresetType>; -} - -export interface DefaultKeywordListUpsertRequest { - name: string; - event_type: AutomodEventType; - actions?: (Array<(BlockMessageAction | FlagToChannelAction | QuarantineUserAction | UserCommunicationDisabledAction)> | null); - enabled?: (boolean | null); - exempt_roles?: (Array<Snowflake> | null); - exempt_channels?: (Array<Snowflake> | null); - trigger_type: (AutomodTriggerType); - trigger_metadata: DefaultKeywordListTriggerMetadata; -} - -export interface DefaultKeywordListUpsertRequestPartial { - name?: string; - event_type?: AutomodEventType; - actions?: (Array<(BlockMessageAction | FlagToChannelAction | QuarantineUserAction | UserCommunicationDisabledAction)> | null); - enabled?: (boolean | null); - exempt_roles?: (Array<Snowflake> | null); - exempt_channels?: (Array<Snowflake> | null); - trigger_type?: (AutomodTriggerType); - trigger_metadata?: DefaultKeywordListTriggerMetadata; -} - -export interface DefaultKeywordRuleResponse { - id: Snowflake; - guild_id: Snowflake; - creator_id: Snowflake; - name: string; - event_type: AutomodEventType; - actions: Array<(BlockMessageActionResponse | FlagToChannelActionResponse | QuarantineUserActionResponse | UserCommunicationDisabledActionResponse)>; - trigger_type: (AutomodTriggerType); - enabled: boolean; - exempt_roles: Array<Snowflake>; - exempt_channels: Array<Snowflake>; - trigger_metadata: DefaultKeywordListTriggerMetadataResponse; -} - -export interface DefaultReactionEmojiResponse { - emoji_id: (null | Snowflake); - emoji_name: (string | null); -} - -export interface DiscordIntegrationResponse { - type: (IntegrationTypes); - name: (string | null); - account: AccountResponse; - enabled: boolean; - id: Snowflake; - application: IntegrationApplicationResponse; - scopes: Array<(OAuth2Scopes)>; - user?: UserResponse; -} - -export interface EmbeddedActivityInstance { - application_id: Snowflake; - instance_id: string; - launch_id: string; - location: (GuildChannelLocation | PrivateChannelLocation); - users: Array<Snowflake>; -} - -export type EmbeddedActivityLocationKind = ('gc' | 'pc' | 'party'); - -export interface EmojiResponse { - id: Snowflake; - name: string; - user?: UserResponse; - roles: Array<Snowflake>; - require_colons: boolean; - managed: boolean; - animated: boolean; - available: boolean; -} - -export type EntitlementOwnerTypes = (1 | 2); - -export interface EntitlementResponse { - id: Snowflake; - sku_id: Snowflake; - application_id: Snowflake; - user_id: Snowflake; - guild_id?: (null | Snowflake); - deleted: boolean; - starts_at: (string | null); - ends_at: (string | null); - type: EntitlementTypes; - fulfilled_at?: (string | null); - fulfillment_status?: (null | EntitlementTenantFulfillmentStatusResponse); - consumed?: boolean; - gifter_user_id?: (null | Snowflake); - parent_id?: (null | Snowflake); -} - -export type EntitlementTenantFulfillmentStatusResponse = (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7); - -export type EntitlementTypes = (8 | 10); - -export interface EntityMetadataExternal { - location: string; -} - -export interface EntityMetadataExternalResponse { - location: string; -} - -export interface EntityMetadataStageInstance {} - -export interface EntityMetadataStageInstanceResponse {} - -export interface EntityMetadataVoice {} - -export interface EntityMetadataVoiceResponse {} - -export interface ExternalConnectionIntegrationResponse { - type: (IntegrationTypes); - name: (string | null); - account: AccountResponse; - enabled: boolean; - id: string; - user: UserResponse; - revoked?: boolean; - expire_behavior?: IntegrationExpireBehaviorTypes; - expire_grace_period?: IntegrationExpireGracePeriodTypes; - subscriber_count?: number; - synced_at?: string; - role_id?: (null | Snowflake); - syncing?: boolean; - enable_emoticons?: boolean; -} - -export interface ExternalScheduledEventCreateRequest { - name: string; - description?: (string | null); - image?: (string | null); - scheduled_start_time: string; - scheduled_end_time?: (string | null); - privacy_level: GuildScheduledEventPrivacyLevels; - entity_type: (GuildScheduledEventEntityTypes); - channel_id?: (null | Snowflake); - recurrence_rule?: (null | RecurrenceRule); - entity_metadata: EntityMetadataExternal; -} - -export interface ExternalScheduledEventPatchRequestPartial { - status?: (null | GuildScheduledEventStatuses); - name?: string; - description?: (string | null); - image?: (string | null); - scheduled_start_time?: string; - scheduled_end_time?: (string | null); - entity_type?: (null | (GuildScheduledEventEntityTypes)); - privacy_level?: GuildScheduledEventPrivacyLevels; - channel_id?: (null | Snowflake); - recurrence_rule?: (null | RecurrenceRule); - entity_metadata?: EntityMetadataExternal; -} - -export interface ExternalScheduledEventResponse { - id: Snowflake; - guild_id: Snowflake; - name: string; - description: (string | null); - channel_id: (null | Snowflake); - creator_id: (null | Snowflake); - creator?: UserResponse; - image: (string | null); - scheduled_start_time: string; - scheduled_end_time: (string | null); - status: GuildScheduledEventStatuses; - entity_type: (GuildScheduledEventEntityTypes); - entity_id: (null | Snowflake); - recurrence_rule: (null | RecurrenceRuleResponse); - user_count?: number; - privacy_level: GuildScheduledEventPrivacyLevels; - user_rsvp?: (null | ScheduledEventUserResponse); - guild_scheduled_event_exceptions: Array<GuildScheduledEventExceptionResponse>; - entity_metadata: EntityMetadataExternalResponse; -} - -export interface FileComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - spoiler?: (boolean | null); - file: UnfurledMediaRequestWithAttachmentReferenceRequired; -} - -export interface FileComponentResponse { - type: (MessageComponentTypes); - id: number; - file: UnfurledMediaResponse; - name: (string | null); - size: (number | null); - spoiler: boolean; -} - -export interface FileUploadComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - min_values?: (number | null); - max_values?: (number | null); - required?: (boolean | null); -} - -export interface FlagToChannelAction { - type: (AutomodActionType); - metadata: FlagToChannelActionMetadata; -} - -export interface FlagToChannelActionMetadata { - channel_id: Snowflake; -} - -export interface FlagToChannelActionMetadataResponse { - channel_id: Snowflake; -} - -export interface FlagToChannelActionResponse { - type: (AutomodActionType); - metadata: FlagToChannelActionMetadataResponse; -} - -export type ForumLayout = (0 | 1 | 2); - -export interface ForumTagResponse { - id: Snowflake; - name: string; - moderated: boolean; - emoji_id: (null | Snowflake); - emoji_name: (string | null); -} - -export interface FriendInviteResponse { - type: (InviteTypes); - code: string; - inviter?: UserResponse; - max_age?: number; - created_at?: string; - expires_at: (string | null); - friends_count?: number; - channel: (null | InviteChannelResponse); - is_contact?: boolean; - uses?: number; - max_uses?: number; - flags?: number; -} - -export interface GatewayBotResponse { - url: string; - session_start_limit: GatewayBotSessionStartLimitResponse; - shards: number; -} - -export interface GatewayBotSessionStartLimitResponse { - max_concurrency: number; - remaining: number; - reset_after: number; - total: number; -} - -export interface GatewayResponse { - url: string; -} - -export interface GithubAuthor { - username?: (string | null); - name: string; -} - -export interface GithubCheckApp { - name: string; -} - -export interface GithubCheckPullRequest { - number: number; -} - -export interface GithubCheckRun { - conclusion?: (string | null); - name: string; - html_url: string; - check_suite: GithubCheckSuite; - details_url?: (string | null); - output?: (null | GithubCheckRunOutput); - pull_requests?: (Array<GithubCheckPullRequest> | null); -} - -export interface GithubCheckRunOutput { - title?: (string | null); - summary?: (string | null); -} - -export interface GithubCheckSuite { - conclusion?: (string | null); - head_branch?: (string | null); - head_sha: string; - pull_requests?: (Array<GithubCheckPullRequest> | null); - app: GithubCheckApp; -} - -export interface GithubComment { - id: number; - html_url: string; - user: GithubUser; - commit_id?: (string | null); - body: string; -} - -export interface GithubCommit { - id: string; - url: string; - message: string; - author: GithubAuthor; -} - -export interface GithubDiscussion { - title: string; - number: number; - html_url: string; - answer_html_url?: (string | null); - body?: (string | null); - user: GithubUser; -} - -export interface GithubIssue { - id: number; - number: number; - html_url: string; - user: GithubUser; - title: string; - body?: (string | null); - pull_request?: any; -} - -export interface GithubRelease { - id: number; - tag_name: string; - html_url: string; - author: GithubUser; -} - -export interface GithubRepository { - id: number; - html_url: string; - name: string; - full_name: string; -} - -export interface GithubReview { - user: GithubUser; - body?: (string | null); - html_url: string; - state: string; -} - -export interface GithubUser { - id: number; - login: string; - html_url: string; - avatar_url: string; -} - -export interface GithubWebhook { - action?: (string | null); - ref?: (string | null); - ref_type?: (string | null); - comment?: (null | GithubComment); - issue?: (null | GithubIssue); - pull_request?: (null | GithubIssue); - repository?: (null | GithubRepository); - forkee?: (null | GithubRepository); - sender: GithubUser; - member?: (null | GithubUser); - release?: (null | GithubRelease); - head_commit?: (null | GithubCommit); - commits?: (Array<GithubCommit> | null); - forced?: (boolean | null); - compare?: (string | null); - review?: (null | GithubReview); - check_run?: (null | GithubCheckRun); - check_suite?: (null | GithubCheckSuite); - discussion?: (null | GithubDiscussion); - answer?: (null | GithubComment); -} - -export interface GroupDMInviteResponse { - type: (InviteTypes); - code: string; - inviter?: UserResponse; - max_age?: number; - created_at?: string; - expires_at: (string | null); - channel: InviteChannelResponse; - approximate_member_count?: (number | null); -} - -export interface GuildAuditLogResponse { - audit_log_entries: Array<AuditLogEntryResponse>; - users: Array<UserResponse>; - integrations: Array<(PartialDiscordIntegrationResponse | PartialExternalConnectionIntegrationResponse | PartialGuildSubscriptionIntegrationResponse)>; - webhooks: Array<(ApplicationIncomingWebhookResponse | ChannelFollowerWebhookResponse | GuildIncomingWebhookResponse)>; - guild_scheduled_events: Array<(ExternalScheduledEventResponse | StageScheduledEventResponse | VoiceScheduledEventResponse)>; - threads: Array<ThreadResponse>; - application_commands: Array<ApplicationCommandResponse>; - auto_moderation_rules: Array<(DefaultKeywordRuleResponse | KeywordRuleResponse | MLSpamRuleResponse | MentionSpamRuleResponse | UserProfileRuleResponse | null)>; -} - -export interface GuildBanResponse { - user: UserResponse; - reason: (string | null); -} - -export interface GuildChannelLocation { - id: string; - kind: (EmbeddedActivityLocationKind); - channel_id: Snowflake; - guild_id: Snowflake; -} - -export interface GuildChannelResponse { - id: Snowflake; - type: (ChannelTypes); - last_message_id?: (null | Snowflake); - flags: number; - last_pin_timestamp?: (string | null); - guild_id: Snowflake; - name: string; - parent_id?: (null | Snowflake); - rate_limit_per_user?: number; - bitrate?: number; - user_limit?: number; - rtc_region?: (string | null); - video_quality_mode?: VideoQualityModes; - permissions?: string; - topic?: (string | null); - default_auto_archive_duration?: ThreadAutoArchiveDuration; - default_thread_rate_limit_per_user?: number; - position: number; - permission_overwrites?: Array<ChannelPermissionOverwriteResponse>; - nsfw?: boolean; - available_tags?: Array<ForumTagResponse>; - default_reaction_emoji?: (null | DefaultReactionEmojiResponse); - default_sort_order?: (null | ThreadSortOrder); - default_forum_layout?: ForumLayout; - default_tag_setting?: (null | ThreadSearchTagSetting); -} - -export type GuildExplicitContentFilterTypes = (0 | 1 | 2); - -export type GuildFeatures = ('ANIMATED_BANNER' | 'ANIMATED_ICON' | 'APPLICATION_COMMAND_PERMISSIONS_V2' | 'AUTO_MODERATION' | 'BANNER' | 'COMMUNITY' | 'CREATOR_MONETIZABLE_PROVISIONAL' | 'CREATOR_STORE_PAGE' | 'DEVELOPER_SUPPORT_SERVER' | 'DISCOVERABLE' | 'FEATURABLE' | 'INVITES_DISABLED' | 'INVITE_SPLASH' | 'MEMBER_VERIFICATION_GATE_ENABLED' | 'MORE_STICKERS' | 'NEWS' | 'PARTNERED' | 'PREVIEW_ENABLED' | 'RAID_ALERTS_DISABLED' | 'ROLE_ICONS' | 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE' | 'ROLE_SUBSCRIPTIONS_ENABLED' | 'TICKETED_EVENTS_ENABLED' | 'VANITY_URL' | 'VERIFIED' | 'VIP_REGIONS' | 'WELCOME_SCREEN_ENABLED' | 'OFFICIAL_GAME_GUILD'); - -export interface GuildHomeSettingsResponse { - guild_id: Snowflake; - enabled: boolean; - welcome_message?: WelcomeMessageResponse; - new_member_actions: Array<NewMemberActionResponse>; - resource_channels: Array<ResourceChannelResponse>; -} - -export interface GuildIncidentActionsRequest { - invites_disabled_until?: (string | null); - dms_disabled_until?: (string | null); -} - -export interface GuildIncidentsDataResponse { - invites_disabled_until: (string | null); - dms_disabled_until: (string | null); -} - -export interface GuildIncomingWebhookResponse { - application_id: (null | Snowflake); - avatar: (string | null); - channel_id: (null | Snowflake); - guild_id?: (null | Snowflake); - id: Snowflake; - name: string; - type: (WebhookTypes); - user?: UserResponse; - token?: string; - url?: string; -} - -export interface GuildInviteResponse { - type: (InviteTypes); - code: string; - inviter?: UserResponse; - max_age?: number; - created_at?: string; - expires_at: (string | null); - is_contact?: boolean; - flags?: number; - guild: InviteGuildResponse; - guild_id: Snowflake; - channel: InviteChannelResponse; - target_type?: InviteTargetTypes; - target_user?: UserResponse; - target_application?: InviteApplicationResponse; - guild_scheduled_event?: ScheduledEventResponse; - uses?: number; - max_uses?: number; - temporary?: boolean; - approximate_member_count?: (number | null); - approximate_presence_count?: (number | null); - is_nickname_changeable?: boolean; - roles?: (Array<InviteGuildRoleResponse> | null); -} - -export type GuildJoinRequestApplicationStatus = ('STARTED' | 'SUBMITTED' | 'REJECTED' | 'APPROVED'); - -export interface GuildJoinRequestResponse { - id: Snowflake; - created_at: string; - reviewed_at: (string | null); - application_status: (null | GuildJoinRequestApplicationStatus); - rejection_reason: (string | null); - guild_id: Snowflake; - user_id: Snowflake; - user?: (null | UserResponse); - form_responses?: (Array<(MultipleChoiceFormFieldResponse | ParagraphFormFieldResponse | TermsFormFieldResponse | TextInputFormFieldResponse)> | null); - actioned_by_user?: (null | UserResponse); -} - -export interface GuildJoinRequestsListResponse { - total?: number; - guild_join_requests?: Array<GuildJoinRequestResponse>; -} - -export type GuildMFALevel = (0 | 1); - -export interface GuildMemberResponse { - avatar: (string | null); - avatar_decoration_data?: (null | UserAvatarDecorationResponse); - banner: (string | null); - communication_disabled_until: (string | null); - flags: number; - joined_at: string; - nick: (string | null); - pending: boolean; - premium_since: (string | null); - roles: Array<Snowflake>; - collectibles?: (null | UserCollectiblesResponse); - user: UserResponse; - mute: boolean; - deaf: boolean; -} - -export type GuildMemberVerificationFormFieldType = ('TERMS' | 'TEXT_INPUT' | 'PARAGRAPH' | 'MULTIPLE_CHOICE'); - -export type GuildNSFWContentLevel = (0 | 1 | 2 | 3); - -export type GuildOnboardingMode = (0 | 1); - -export interface GuildOnboardingResponse { - guild_id: Snowflake; - prompts: Array<OnboardingPromptResponse>; - default_channel_ids: Array<Snowflake>; - enabled: boolean; - mode: GuildOnboardingMode; -} - -export interface GuildPatchRequestPartial { - name?: string; - description?: (string | null); - region?: (string | null); - icon?: (string | null); - verification_level?: (null | VerificationLevels); - default_message_notifications?: (null | UserNotificationSettings); - explicit_content_filter?: (null | GuildExplicitContentFilterTypes); - preferred_locale?: (null | AvailableLocalesEnum); - afk_timeout?: (null | AfkTimeouts); - afk_channel_id?: (null | Snowflake); - system_channel_id?: (null | Snowflake); - splash?: (string | null); - banner?: (string | null); - system_channel_flags?: (number | null); - features?: (Array<(string | null)> | null); - discovery_splash?: (string | null); - home_header?: (string | null); - rules_channel_id?: (null | Snowflake); - safety_alerts_channel_id?: (null | Snowflake); - public_updates_channel_id?: (null | Snowflake); - premium_progress_bar_enabled?: (boolean | null); -} - -export interface GuildPreviewResponse { - id: Snowflake; - name: string; - icon: (string | null); - description: (string | null); - home_header: (string | null); - splash: (string | null); - discovery_splash: (string | null); - features: Array<GuildFeatures>; - approximate_member_count: number; - approximate_presence_count: number; - emojis: Array<EmojiResponse>; - stickers: Array<GuildStickerResponse>; -} - -export interface GuildProductPurchaseResponse { - listing_id: Snowflake; - product_name: string; -} - -export interface GuildPruneResponse { - pruned: (number | null); -} - -export interface GuildResponse { - id: Snowflake; - name: string; - icon: (string | null); - description: (string | null); - home_header: (string | null); - splash: (string | null); - discovery_splash: (string | null); - features: Array<GuildFeatures>; - banner: (string | null); - owner_id: Snowflake; - application_id: (null | Snowflake); - region: string; - afk_channel_id: (null | Snowflake); - afk_timeout: AfkTimeouts; - system_channel_id: (null | Snowflake); - system_channel_flags: number; - widget_enabled: boolean; - widget_channel_id: (null | Snowflake); - verification_level: VerificationLevels; - roles: Array<GuildRoleResponse>; - default_message_notifications: UserNotificationSettings; - mfa_level: GuildMFALevel; - explicit_content_filter: GuildExplicitContentFilterTypes; - max_presences: (number | null); - max_members: number; - max_stage_video_channel_users: number; - max_video_channel_users: number; - vanity_url_code: (string | null); - premium_tier: PremiumGuildTiers; - premium_subscription_count: number; - preferred_locale: AvailableLocalesEnum; - rules_channel_id: (null | Snowflake); - safety_alerts_channel_id: (null | Snowflake); - public_updates_channel_id: (null | Snowflake); - premium_progress_bar_enabled: boolean; - premium_progress_bar_enabled_user_updated_at?: (string | null); - nsfw: boolean; - nsfw_level: GuildNSFWContentLevel; - emojis: Array<EmojiResponse>; - stickers: Array<GuildStickerResponse>; - incidents_data: (null | GuildIncidentsDataResponse); -} - -export interface GuildRoleColorsResponse { - primary_color: number; - secondary_color: (number | null); - tertiary_color: (number | null); -} - -export interface GuildRoleResponse { - id: Snowflake; - name: string; - permissions: string; - position: number; - color: number; - colors: GuildRoleColorsResponse; - hoist: boolean; - managed: boolean; - mentionable: boolean; - icon: (string | null); - unicode_emoji: (string | null); - tags?: GuildRoleTagsResponse; - flags: number; -} - -export interface GuildRoleTagsResponse { - premium_subscriber?: null; - bot_id?: Snowflake; - integration_id?: Snowflake; - subscription_listing_id?: Snowflake; - available_for_purchase?: null; - guild_connections?: null; -} - -export type GuildScheduledEventEntityTypes = (0 | 1 | 2 | 3); - -export interface GuildScheduledEventExceptionCreateRequest { - scheduled_start_time?: (string | null); - scheduled_end_time?: (string | null); - original_scheduled_start_time: string; - is_canceled?: (boolean | null); -} - -export interface GuildScheduledEventExceptionPatchRequestPartial { - scheduled_start_time?: (string | null); - scheduled_end_time?: (string | null); - is_canceled?: (boolean | null); -} - -export interface GuildScheduledEventExceptionResponse { - event_id: Snowflake; - event_exception_id: Snowflake; - scheduled_start_time: (string | null); - scheduled_end_time: (string | null); - is_canceled: boolean; -} - -export type GuildScheduledEventPrivacyLevels = (2); - -export type GuildScheduledEventStatuses = (1 | 2 | 3 | 4); - -export type GuildScheduledEventUserResponses = (0 | 1); - -export interface GuildSearchResponse { - messages: Array<Array<SearchMessageResponse>>; - doing_deep_historical_index: boolean; - total_results: number; - threads?: (Array<ThreadResponse> | null); - members?: (Array<ThreadMemberResponse> | null); - documents_indexed?: (number | null); -} - -export interface GuildStickerResponse { - id: Snowflake; - name: string; - tags: string; - type: (StickerTypes); - format_type: (null | StickerFormatTypes); - description: (string | null); - available: boolean; - guild_id: Snowflake; - user?: UserResponse; -} - -export interface GuildSubscriptionIntegrationResponse { - type: (IntegrationTypes); - name: (string | null); - account: AccountResponse; - enabled: boolean; - id: Snowflake; -} - -export interface GuildTemplateChannelResponse { - id: (number | null); - type: (ChannelTypes); - name: (string | null); - position: (number | null); - topic: (string | null); - bitrate: number; - user_limit: number; - nsfw: boolean; - rate_limit_per_user: number; - parent_id: (null | Snowflake); - default_auto_archive_duration: (null | ThreadAutoArchiveDuration); - permission_overwrites: Array<ChannelPermissionOverwriteResponse>; - available_tags: (Array<GuildTemplateChannelTags> | null); - template: string; - default_reaction_emoji: (null | DefaultReactionEmojiResponse); - default_thread_rate_limit_per_user: (number | null); - default_sort_order: (null | ThreadSortOrder); - default_forum_layout: (null | ForumLayout); - default_tag_setting: (null | ThreadSearchTagSetting); - theme_color: (number | null); -} - -export interface GuildTemplateChannelTags { - id: (number | null); - name: string; - emoji_id: (null | Snowflake); - emoji_name: (string | null); - moderated: (boolean | null); -} - -export interface GuildTemplateResponse { - code: string; - name: string; - description: (string | null); - usage_count: number; - creator_id: Snowflake; - creator: (null | UserResponse); - created_at: string; - updated_at: string; - source_guild_id: Snowflake; - serialized_source_guild: GuildTemplateSnapshotResponse; - is_dirty: (boolean | null); -} - -export interface GuildTemplateRoleColorsResponse { - primary_color: number; - secondary_color: (number | null); - tertiary_color: (number | null); -} - -export interface GuildTemplateRoleResponse { - id: number; - name: string; - permissions: string; - color: number; - colors: (null | GuildTemplateRoleColorsResponse); - hoist: boolean; - mentionable: boolean; - icon: (string | null); - unicode_emoji: (string | null); -} - -export interface GuildTemplateSnapshotResponse { - name: string; - description: (string | null); - region: (string | null); - verification_level: VerificationLevels; - default_message_notifications: UserNotificationSettings; - explicit_content_filter: GuildExplicitContentFilterTypes; - preferred_locale: AvailableLocalesEnum; - afk_channel_id: (null | Snowflake); - afk_timeout: AfkTimeouts; - system_channel_id: (null | Snowflake); - system_channel_flags: number; - roles: Array<GuildTemplateRoleResponse>; - channels: Array<GuildTemplateChannelResponse>; -} - -export interface GuildWelcomeChannel { - channel_id: Snowflake; - description: string; - emoji_id?: (null | Snowflake); - emoji_name?: (string | null); -} - -export interface GuildWelcomeScreenChannelResponse { - channel_id: Snowflake; - description: string; - emoji_id: (null | Snowflake); - emoji_name: (string | null); -} - -export interface GuildWelcomeScreenResponse { - description: (string | null); - welcome_channels: Array<GuildWelcomeScreenChannelResponse>; -} - -export interface GuildWithCountsResponse { - id: Snowflake; - name: string; - icon: (string | null); - description: (string | null); - home_header: (string | null); - splash: (string | null); - discovery_splash: (string | null); - features: Array<GuildFeatures>; - banner: (string | null); - owner_id: Snowflake; - application_id: (null | Snowflake); - region: string; - afk_channel_id: (null | Snowflake); - afk_timeout: AfkTimeouts; - system_channel_id: (null | Snowflake); - system_channel_flags: number; - widget_enabled: boolean; - widget_channel_id: (null | Snowflake); - verification_level: VerificationLevels; - roles: Array<GuildRoleResponse>; - default_message_notifications: UserNotificationSettings; - mfa_level: GuildMFALevel; - explicit_content_filter: GuildExplicitContentFilterTypes; - max_presences: (number | null); - max_members: number; - max_stage_video_channel_users: number; - max_video_channel_users: number; - vanity_url_code: (string | null); - premium_tier: PremiumGuildTiers; - premium_subscription_count: number; - preferred_locale: AvailableLocalesEnum; - rules_channel_id: (null | Snowflake); - safety_alerts_channel_id: (null | Snowflake); - public_updates_channel_id: (null | Snowflake); - premium_progress_bar_enabled: boolean; - premium_progress_bar_enabled_user_updated_at?: (string | null); - nsfw: boolean; - nsfw_level: GuildNSFWContentLevel; - emojis: Array<EmojiResponse>; - stickers: Array<GuildStickerResponse>; - incidents_data: (null | GuildIncidentsDataResponse); - approximate_member_count?: (number | null); - approximate_presence_count?: (number | null); -} - -export type HasOption = ('link' | 'embed' | 'file' | 'image' | 'video' | 'sound' | 'sticker' | 'poll' | 'snapshot' | '-link' | '-embed' | '-file' | '-image' | '-video' | '-sound' | '-sticker' | '-poll' | '-snapshot'); - -export interface IncomingWebhookInteractionRequest { - content?: (string | null); - embeds?: (Array<RichEmbed> | null); - allowed_mentions?: (null | MessageAllowedMentionsRequest); - components?: (Array<(ActionRowComponentForMessageRequest | ContainerComponentForMessageRequest | FileComponentForMessageRequest | MediaGalleryComponentForMessageRequest | SectionComponentForMessageRequest | SeparatorComponentForMessageRequest | TextDisplayComponentForMessageRequest)> | null); - attachments?: (Array<MessageAttachmentRequest> | null); - poll?: (null | PollCreateRequest); - tts?: (boolean | null); - flags?: (number | null); -} - -export interface IncomingWebhookRequestPartial { - content?: (string | null); - embeds?: (Array<RichEmbed> | null); - allowed_mentions?: (null | MessageAllowedMentionsRequest); - components?: (Array<(ActionRowComponentForMessageRequest | ContainerComponentForMessageRequest | FileComponentForMessageRequest | MediaGalleryComponentForMessageRequest | SectionComponentForMessageRequest | SeparatorComponentForMessageRequest | TextDisplayComponentForMessageRequest)> | null); - attachments?: (Array<MessageAttachmentRequest> | null); - poll?: (null | PollCreateRequest); - tts?: (boolean | null); - flags?: (number | null); - username?: (string | null); - avatar_url?: (string | null); - thread_name?: (string | null); - applied_tags?: (Array<Snowflake> | null); -} - -export interface IncomingWebhookUpdateForInteractionCallbackRequestPartial { - content?: (string | null); - embeds?: (Array<RichEmbed> | null); - allowed_mentions?: (null | MessageAllowedMentionsRequest); - components?: (Array<(ActionRowComponentForMessageRequest | ContainerComponentForMessageRequest | FileComponentForMessageRequest | MediaGalleryComponentForMessageRequest | SectionComponentForMessageRequest | SeparatorComponentForMessageRequest | TextDisplayComponentForMessageRequest)> | null); - attachments?: (Array<MessageAttachmentRequest> | null); - flags?: (number | null); -} - -export interface IncomingWebhookUpdateRequestPartial { - content?: (string | null); - embeds?: (Array<RichEmbed> | null); - allowed_mentions?: (null | MessageAllowedMentionsRequest); - components?: (Array<(ActionRowComponentForMessageRequest | ContainerComponentForMessageRequest | FileComponentForMessageRequest | MediaGalleryComponentForMessageRequest | SectionComponentForMessageRequest | SeparatorComponentForMessageRequest | TextDisplayComponentForMessageRequest)> | null); - attachments?: (Array<MessageAttachmentRequest> | null); - poll?: (null | PollCreateRequest); - flags?: (number | null); -} - -export type Int53Type = number; - -export interface IntegrationApplicationResponse { - id: Snowflake; - name: string; - icon: (string | null); - description: string; - type: (null | ApplicationTypes); - cover_image?: string; - primary_sku_id?: Snowflake; - bot?: UserResponse; -} - -export type IntegrationExpireBehaviorTypes = (0 | 1); - -export type IntegrationExpireGracePeriodTypes = (1 | 3 | 7 | 14 | 30); - -export type IntegrationTypes = ('discord' | 'twitch' | 'youtube' | 'guild_subscription'); - -export interface InteractionApplicationCommandAutocompleteCallbackIntegerData { - choices?: (Array<(null | ApplicationCommandOptionIntegerChoice)> | null); -} - -export interface InteractionApplicationCommandAutocompleteCallbackNumberData { - choices?: (Array<(null | ApplicationCommandOptionNumberChoice)> | null); -} - -export interface InteractionApplicationCommandAutocompleteCallbackStringData { - choices?: (Array<(null | ApplicationCommandOptionStringChoice)> | null); -} - -export interface InteractionCallbackResponse { - interaction: InteractionResponse; - resource?: (CreateMessageInteractionCallbackResponse | LaunchActivityInteractionCallbackResponse | UpdateMessageInteractionCallbackResponse); -} - -export type InteractionCallbackTypes = (1 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13); - -export type InteractionContextType = (0 | 1 | 2); - -export interface InteractionResponse { - id: Snowflake; - type: InteractionTypes; - activity_instance_id?: (string | null); - response_message_id?: Snowflake; - response_message_loading?: boolean; - response_message_ephemeral?: boolean; - channel_id?: Snowflake; - guild_id?: Snowflake; -} - -export type InteractionTypes = (1 | 2 | 3 | 4 | 5 | 6); - -export interface InviteApplicationResponse { - id: Snowflake; - name: string; - icon: (string | null); - description: string; - type: (null | ApplicationTypes); - cover_image?: string; - primary_sku_id?: Snowflake; - bot?: UserResponse; - slug?: string; - guild_id?: Snowflake; - rpc_origins?: Array<string>; - bot_public?: boolean; - bot_require_code_grant?: boolean; - terms_of_service_url?: string; - privacy_policy_url?: string; - custom_install_url?: string; - install_params?: ApplicationOAuth2InstallParamsResponse; - integration_types_config?: { - [key: string]: ApplicationIntegrationTypeConfigurationResponse; -}; - verify_key: string; - flags: number; - flags_new: string; - max_participants?: (number | null); - tags?: Array<string>; -} - -export interface InviteChannelRecipientResponse { - id: Snowflake; - username: string; - avatar: (string | null); -} - -export interface InviteChannelResponse { - id: Snowflake; - type: ChannelTypes; - name: (string | null); - icon?: string; - recipients?: Array<InviteChannelRecipientResponse>; -} - -export interface InviteGuildResponse { - id: Snowflake; - name: string; - splash: (string | null); - banner: (string | null); - description: (string | null); - icon: (string | null); - features: Array<GuildFeatures>; - verification_level: (null | VerificationLevels); - vanity_url_code: (string | null); - nsfw_level: (null | GuildNSFWContentLevel); - nsfw: (boolean | null); - premium_subscription_count: number; -} - -export interface InviteGuildRoleResponse { - id: Snowflake; - name: string; - position: number; - color: number; - colors: GuildRoleColorsResponse; - icon: (string | null); - unicode_emoji: (string | null); - permissions?: string; -} - -export type InviteTargetTypes = (1 | 2 | 3); - -export type InviteTypes = (0 | 1 | 2); - -export interface KeywordRuleResponse { - id: Snowflake; - guild_id: Snowflake; - creator_id: Snowflake; - name: string; - event_type: AutomodEventType; - actions: Array<(BlockMessageActionResponse | FlagToChannelActionResponse | QuarantineUserActionResponse | UserCommunicationDisabledActionResponse)>; - trigger_type: (AutomodTriggerType); - enabled: boolean; - exempt_roles: Array<Snowflake>; - exempt_channels: Array<Snowflake>; - trigger_metadata: KeywordTriggerMetadataResponse; -} - -export interface KeywordTriggerMetadata { - keyword_filter?: (Array<string> | null); - regex_patterns?: (Array<string> | null); - allow_list?: (Array<string> | null); -} - -export interface KeywordTriggerMetadataResponse { - keyword_filter: Array<string>; - regex_patterns: Array<string>; - allow_list: Array<string>; -} - -export interface KeywordUpsertRequest { - name: string; - event_type: AutomodEventType; - actions?: (Array<(BlockMessageAction | FlagToChannelAction | QuarantineUserAction | UserCommunicationDisabledAction)> | null); - enabled?: (boolean | null); - exempt_roles?: (Array<Snowflake> | null); - exempt_channels?: (Array<Snowflake> | null); - trigger_type: (AutomodTriggerType); - trigger_metadata?: (null | KeywordTriggerMetadata); -} - -export interface KeywordUpsertRequestPartial { - name?: string; - event_type?: AutomodEventType; - actions?: (Array<(BlockMessageAction | FlagToChannelAction | QuarantineUserAction | UserCommunicationDisabledAction)> | null); - enabled?: (boolean | null); - exempt_roles?: (Array<Snowflake> | null); - exempt_channels?: (Array<Snowflake> | null); - trigger_type?: (AutomodTriggerType); - trigger_metadata?: (null | KeywordTriggerMetadata); -} - -export interface LabelComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - label: string; - description?: (string | null); - component: (ChannelSelectComponentForModalRequest | CheckboxComponentForModalRequest | CheckboxGroupComponentForModalRequest | FileUploadComponentForModalRequest | MentionableSelectComponentForModalRequest | RadioGroupComponentForModalRequest | RoleSelectComponentForModalRequest | StringSelectComponentForModalRequest | TextInputComponentForModalRequest | UserSelectComponentForModalRequest); -} - -export interface LaunchActivityInteractionCallbackRequest { - type: (InteractionCallbackTypes); -} - -export interface LaunchActivityInteractionCallbackResponse { - type: (InteractionCallbackTypes); - activity_instance: ActivityInstanceCallbackResponse; -} - -export interface ListApplicationEmojisResponse { - items: Array<EmojiResponse>; -} - -export interface ListGuildSoundboardSoundsResponse { - items: Array<SoundboardSoundResponse>; -} - -export interface LobbyGuildInviteResponse { - code: string; -} - -export interface LobbyMemberRequest { - id: Snowflake; - metadata?: ({ - [key: string]: string; -} | null); - flags?: (null | 1); -} - -export interface LobbyMemberResponse { - id: Snowflake; - metadata: ({ - [key: string]: string; -} | null); - flags: number; -} - -export interface LobbyMessageResponse { - id: Snowflake; - type: MessageType; - content: string; - lobby_id: Snowflake; - channel_id: Snowflake; - author: UserResponse; - metadata?: { - [key: string]: string; -}; - moderation_metadata?: { - [key: string]: string; -}; - flags: number; - application_id?: Snowflake; -} - -export interface LobbyResponse { - id: Snowflake; - application_id: Snowflake; - metadata: ({ - [key: string]: string; -} | null); - members: Array<LobbyMemberResponse>; - linked_channel?: GuildChannelResponse; - flags: UInt32Type; - override_event_webhooks_url?: (string | null); -} - -export interface MLSpamRuleResponse { - id: Snowflake; - guild_id: Snowflake; - creator_id: Snowflake; - name: string; - event_type: AutomodEventType; - actions: Array<(BlockMessageActionResponse | FlagToChannelActionResponse | QuarantineUserActionResponse | UserCommunicationDisabledActionResponse)>; - trigger_type: (AutomodTriggerType); - enabled: boolean; - exempt_roles: Array<Snowflake>; - exempt_channels: Array<Snowflake>; - trigger_metadata: MLSpamTriggerMetadataResponse; -} - -export interface MLSpamTriggerMetadata {} - -export interface MLSpamTriggerMetadataResponse {} - -export interface MLSpamUpsertRequest { - name: string; - event_type: AutomodEventType; - actions?: (Array<(BlockMessageAction | FlagToChannelAction | QuarantineUserAction | UserCommunicationDisabledAction)> | null); - enabled?: (boolean | null); - exempt_roles?: (Array<Snowflake> | null); - exempt_channels?: (Array<Snowflake> | null); - trigger_type: (AutomodTriggerType); - trigger_metadata?: (null | MLSpamTriggerMetadata); -} - -export interface MLSpamUpsertRequestPartial { - name?: string; - event_type?: AutomodEventType; - actions?: (Array<(BlockMessageAction | FlagToChannelAction | QuarantineUserAction | UserCommunicationDisabledAction)> | null); - enabled?: (boolean | null); - exempt_roles?: (Array<Snowflake> | null); - exempt_channels?: (Array<Snowflake> | null); - trigger_type?: (AutomodTriggerType); - trigger_metadata?: (null | MLSpamTriggerMetadata); -} - -export interface MediaGalleryComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - items: Array<MediaGalleryItemRequest>; -} - -export interface MediaGalleryComponentResponse { - type: (MessageComponentTypes); - id: number; - items: Array<MediaGalleryItemResponse>; -} - -export interface MediaGalleryItemRequest { - description?: (string | null); - spoiler?: (boolean | null); - media: UnfurledMediaRequest; -} - -export interface MediaGalleryItemResponse { - media: UnfurledMediaResponse; - description: (string | null); - spoiler: boolean; -} - -export interface MentionSpamRuleResponse { - id: Snowflake; - guild_id: Snowflake; - creator_id: Snowflake; - name: string; - event_type: AutomodEventType; - actions: Array<(BlockMessageActionResponse | FlagToChannelActionResponse | QuarantineUserActionResponse | UserCommunicationDisabledActionResponse)>; - trigger_type: (AutomodTriggerType); - enabled: boolean; - exempt_roles: Array<Snowflake>; - exempt_channels: Array<Snowflake>; - trigger_metadata: MentionSpamTriggerMetadataResponse; -} - -export interface MentionSpamTriggerMetadata { - mention_total_limit?: (number | null); - mention_raid_protection_enabled?: (boolean | null); -} - -export interface MentionSpamTriggerMetadataResponse { - mention_total_limit: number; - mention_raid_protection_enabled: boolean; -} - -export interface MentionSpamUpsertRequest { - name: string; - event_type: AutomodEventType; - actions?: (Array<(BlockMessageAction | FlagToChannelAction | QuarantineUserAction | UserCommunicationDisabledAction)> | null); - enabled?: (boolean | null); - exempt_roles?: (Array<Snowflake> | null); - exempt_channels?: (Array<Snowflake> | null); - trigger_type: (AutomodTriggerType); - trigger_metadata?: (null | MentionSpamTriggerMetadata); -} - -export interface MentionSpamUpsertRequestPartial { - name?: string; - event_type?: AutomodEventType; - actions?: (Array<(BlockMessageAction | FlagToChannelAction | QuarantineUserAction | UserCommunicationDisabledAction)> | null); - enabled?: (boolean | null); - exempt_roles?: (Array<Snowflake> | null); - exempt_channels?: (Array<Snowflake> | null); - trigger_type?: (AutomodTriggerType); - trigger_metadata?: (null | MentionSpamTriggerMetadata); -} - -export interface MentionableSelectComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - placeholder?: (string | null); - min_values?: (number | null); - max_values?: (number | null); - disabled?: (boolean | null); - required?: (boolean | null); - default_values?: (Array<(RoleSelectDefaultValue | UserSelectDefaultValue)> | null); -} - -export interface MentionableSelectComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - placeholder?: (string | null); - min_values?: (number | null); - max_values?: (number | null); - disabled?: (boolean | null); - required?: (boolean | null); - default_values?: (Array<(RoleSelectDefaultValue | UserSelectDefaultValue)> | null); -} - -export interface MentionableSelectComponentResponse { - type: (MessageComponentTypes); - id: number; - custom_id: string; - placeholder?: string; - min_values: number; - max_values: number; - disabled?: boolean; - default_values?: Array<(RoleSelectDefaultValueResponse | UserSelectDefaultValueResponse)>; -} - -export interface MessageActivityResponse { - type: ActivityActionTypes; - party_id?: string; -} - -export interface MessageAllowedMentionsRequest { - parse?: (Array<(null | AllowedMentionTypes)> | null); - users?: (Array<(null | Snowflake)> | null); - roles?: (Array<(null | Snowflake)> | null); - replied_user?: (boolean | null); -} - -export interface MessageAttachmentRequest { - id: Snowflake; - filename?: (string | null); - description?: (string | null); - duration_secs?: (number | null); - waveform?: (string | null); - title?: (string | null); - is_remix?: (boolean | null); -} - -export interface MessageAttachmentResponse { - id: Snowflake; - filename: string; - size: number; - url: string; - proxy_url: string; - width?: number; - height?: number; - duration_secs?: number; - waveform?: string; - description?: string; - content_type?: string; - ephemeral?: boolean; - flags?: number; - placeholder?: string; - placeholder_version?: number; - title?: (string | null); - application?: ApplicationResponse; - clip_created_at?: string; - clip_participants?: Array<UserResponse>; -} - -export interface MessageCallResponse { - ended_timestamp?: (string | null); - participants: Array<Snowflake>; -} - -export interface MessageComponentInteractionMetadataResponse { - id: Snowflake; - type: (InteractionTypes); - user?: UserResponse; - authorizing_integration_owners: { - [key: string]: Snowflake; -}; - original_response_message_id?: Snowflake; - interacted_message_id: Snowflake; -} - -export type MessageComponentSeparatorSpacingSize = (1 | 2); - -export type MessageComponentTypes = (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 21 | 22 | 23); - -export interface MessageCreateRequest { - content?: (string | null); - embeds?: (Array<RichEmbed> | null); - allowed_mentions?: (null | MessageAllowedMentionsRequest); - sticker_ids?: (Array<Snowflake> | null); - components?: (Array<(ActionRowComponentForMessageRequest | ContainerComponentForMessageRequest | FileComponentForMessageRequest | MediaGalleryComponentForMessageRequest | SectionComponentForMessageRequest | SeparatorComponentForMessageRequest | TextDisplayComponentForMessageRequest)> | null); - flags?: (number | null); - attachments?: (Array<MessageAttachmentRequest> | null); - poll?: (null | PollCreateRequest); - shared_client_theme?: (null | CustomClientThemeShareRequest); - message_reference?: (null | MessageReferenceRequest); - nonce?: (number | string | null); - enforce_nonce?: (boolean | null); - tts?: (boolean | null); -} - -export interface MessageEditRequestPartial { - content?: (string | null); - embeds?: (Array<RichEmbed> | null); - flags?: (number | null); - allowed_mentions?: (null | MessageAllowedMentionsRequest); - sticker_ids?: (Array<Snowflake> | null); - components?: (Array<(ActionRowComponentForMessageRequest | ContainerComponentForMessageRequest | FileComponentForMessageRequest | MediaGalleryComponentForMessageRequest | SectionComponentForMessageRequest | SeparatorComponentForMessageRequest | TextDisplayComponentForMessageRequest)> | null); - attachments?: (Array<MessageAttachmentRequest> | null); -} - -export interface MessageEmbedAuthorResponse { - name: string; - url?: string; - icon_url?: string; - proxy_icon_url?: string; -} - -export interface MessageEmbedFieldResponse { - name: string; - value: string; - inline: boolean; -} - -export interface MessageEmbedFooterResponse { - text: string; - icon_url?: string; - proxy_icon_url?: string; -} - -export interface MessageEmbedImageResponse { - url?: string; - proxy_url?: string; - width?: UInt32Type; - height?: UInt32Type; - content_type?: string; - placeholder?: string; - placeholder_version?: UInt32Type; - description?: string; - flags?: UInt32Type; -} - -export interface MessageEmbedProviderResponse { - name: string; - url?: string; -} - -export interface MessageEmbedResponse { - type: string; - url?: string; - title?: string; - description?: string; - color?: number; - timestamp?: string; - fields?: Array<MessageEmbedFieldResponse>; - author?: MessageEmbedAuthorResponse; - provider?: MessageEmbedProviderResponse; - image?: MessageEmbedImageResponse; - thumbnail?: MessageEmbedImageResponse; - video?: MessageEmbedVideoResponse; - footer?: MessageEmbedFooterResponse; - flags?: (number | null); - components?: Array<ContainerComponentResponse>; -} - -export interface MessageEmbedVideoResponse { - url?: string; - proxy_url?: string; - width?: UInt32Type; - height?: UInt32Type; - content_type?: string; - placeholder?: string; - placeholder_version?: UInt32Type; - description?: string; - flags?: UInt32Type; -} - -export interface MessageInteractionResponse { - id: Snowflake; - type: InteractionTypes; - name: string; - user?: UserResponse; - name_localized?: string; -} - -export interface MessageMentionChannelResponse { - id: Snowflake; - name: string; - type: ChannelTypes; - guild_id: Snowflake; -} - -export interface MessageReactionCountDetailsResponse { - burst: number; - normal: number; -} - -export interface MessageReactionEmojiResponse { - id: (null | Snowflake); - name: (string | null); - animated?: boolean; -} - -export interface MessageReactionResponse { - emoji: MessageReactionEmojiResponse; - count: number; - count_details: MessageReactionCountDetailsResponse; - burst_colors: Array<string>; - me_burst: boolean; - me: boolean; -} - -export interface MessageReferenceRequest { - guild_id?: (null | Snowflake); - channel_id?: (null | Snowflake); - message_id: Snowflake; - fail_if_not_exists?: (boolean | null); - type?: (null | MessageReferenceType); -} - -export interface MessageReferenceResponse { - type: MessageReferenceType; - channel_id: Snowflake; - message_id?: Snowflake; - guild_id?: Snowflake; -} - -export type MessageReferenceType = (0); - -export interface MessageResponse { - type: MessageType; - content: string; - mentions: Array<UserResponse>; - mention_roles: Array<Snowflake>; - attachments: Array<MessageAttachmentResponse>; - embeds: Array<MessageEmbedResponse>; - timestamp: string; - edited_timestamp: (string | null); - flags: number; - components: Array<(ActionRowComponentResponse | ContainerComponentResponse | FileComponentResponse | MediaGalleryComponentResponse | SectionComponentResponse | SeparatorComponentResponse | TextDisplayComponentResponse)>; - stickers?: Array<(GuildStickerResponse | StandardStickerResponse)>; - sticker_items?: Array<MessageStickerItemResponse>; - id: Snowflake; - channel_id: Snowflake; - author: UserResponse; - pinned: boolean; - mention_everyone: boolean; - tts: boolean; - call?: MessageCallResponse; - activity?: MessageActivityResponse; - application?: BasicApplicationResponseWithBot; - application_id?: Snowflake; - interaction?: MessageInteractionResponse; - nonce?: (number | string); - webhook_id?: Snowflake; - message_reference?: MessageReferenceResponse; - thread?: ThreadResponse; - mention_channels?: Array<MessageMentionChannelResponse>; - role_subscription_data?: MessageRoleSubscriptionDataResponse; - purchase_notification?: PurchaseNotificationResponse; - position?: number; - resolved?: ResolvedObjectsResponse; - poll?: PollResponse; - shared_client_theme?: CustomClientThemeResponse; - interaction_metadata?: (ApplicationCommandInteractionMetadataResponse | MessageComponentInteractionMetadataResponse | ModalSubmitInteractionMetadataResponse); - message_snapshots?: Array<MessageSnapshotResponse>; - reactions?: Array<MessageReactionResponse>; - referenced_message?: (null | BasicMessageResponse); -} - -export interface MessageRoleSubscriptionDataResponse { - role_subscription_listing_id: Snowflake; - tier_name: string; - total_months_subscribed: number; - is_renewal: boolean; -} - -export type MessageShareCustomUserThemeBaseTheme = (0 | 1 | 2 | 3 | 4); - -export interface MessageSnapshotResponse { - message: MinimalContentMessageResponse; -} - -export interface MessageStickerItemResponse { - id: Snowflake; - name: string; - format_type: StickerFormatTypes; -} - -export type MessageType = (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 31 | 32 | 36 | 37 | 38 | 39 | 46 | 55); - -export type MetadataItemTypes = (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8); - -export interface MinimalContentMessageResponse { - type: MessageType; - content: string; - mentions: Array<UserResponse>; - mention_roles: Array<Snowflake>; - attachments: Array<MessageAttachmentResponse>; - embeds: Array<MessageEmbedResponse>; - timestamp: string; - edited_timestamp: (string | null); - flags: number; - components: Array<(ActionRowComponentResponse | ContainerComponentResponse | FileComponentResponse | MediaGalleryComponentResponse | SectionComponentResponse | SeparatorComponentResponse | TextDisplayComponentResponse)>; - stickers?: Array<(GuildStickerResponse | StandardStickerResponse)>; - sticker_items?: Array<MessageStickerItemResponse>; -} - -export interface ModalInteractionCallbackRequest { - type: (InteractionCallbackTypes); - data: ModalInteractionCallbackRequestData; -} - -export interface ModalInteractionCallbackRequestData { - custom_id: string; - title: string; - components: Array<(ActionRowComponentForModalRequest | LabelComponentForModalRequest | TextDisplayComponentForModalRequest)>; -} - -export interface ModalSubmitInteractionMetadataResponse { - id: Snowflake; - type: (InteractionTypes); - user?: UserResponse; - authorizing_integration_owners: { - [key: string]: Snowflake; -}; - original_response_message_id?: Snowflake; - triggering_interaction_metadata: (ApplicationCommandInteractionMetadataResponse | MessageComponentInteractionMetadataResponse); -} - -export interface MultipleChoiceFormFieldResponse { - field_type: (GuildMemberVerificationFormFieldType); - label?: string; - description?: string; - required?: boolean; - choices: Array<string>; - response?: number; -} - -export interface MyGuildResponse { - id: Snowflake; - name: string; - icon: (string | null); - banner: (string | null); - owner: boolean; - permissions: string; - features: Array<GuildFeatures>; - approximate_member_count?: (number | null); - approximate_presence_count?: (number | null); -} - -export type NameplatePalette = ('crimson' | 'berry' | 'sky' | 'teal' | 'forest' | 'bubble_gum' | 'violet' | 'cobalt' | 'clover' | 'lemon' | 'white' | 'black'); - -export interface NewMemberActionResponse { - channel_id: Snowflake; - action_type: NewMemberActionType; - title: string; - description: string; - emoji?: SettingsEmojiResponse; - icon?: string; -} - -export type NewMemberActionType = (0 | 1); - -export interface OAuth2GetAuthorizationResponse { - application: ApplicationResponse; - expires: string; - scopes: Array<OAuth2Scopes>; - user?: UserResponse; -} - -export interface OAuth2GetKeys { - keys: Array<OAuth2Key>; -} - -export interface OAuth2GetOpenIDConnectUserInfoResponse { - sub: string; - email?: (string | null); - email_verified?: boolean; - preferred_username?: string; - nickname?: (string | null); - picture?: string; - locale?: string; -} - -export interface OAuth2Key { - kty: string; - use: string; - kid: string; - n: string; - e: string; - alg: string; -} - -export type OAuth2Scopes = ('identify' | 'email' | 'connections' | 'guilds' | 'guilds.join' | 'guilds.members.read' | 'gdm.join' | 'bot' | 'rpc' | 'rpc.notifications.read' | 'rpc.voice.read' | 'rpc.voice.write' | 'rpc.video.read' | 'rpc.video.write' | 'rpc.screenshare.read' | 'rpc.screenshare.write' | 'rpc.activities.write' | 'webhook.incoming' | 'messages.read' | 'applications.builds.upload' | 'applications.builds.read' | 'applications.commands' | 'applications.commands.permissions.update' | 'applications.commands.update' | 'applications.store.update' | 'applications.entitlements' | 'activities.read' | 'activities.write' | 'activities.invites.write' | 'relationships.read' | 'voice' | 'dm_channels.read' | 'role_connections.write' | 'openid'); - -export interface OnboardingPromptOptionRequest { - id?: (null | Snowflake); - title: string; - description?: (string | null); - emoji_id?: (null | Snowflake); - emoji_name?: (string | null); - emoji_animated?: (boolean | null); - role_ids?: (Array<Snowflake> | null); - channel_ids?: (Array<Snowflake> | null); -} - -export interface OnboardingPromptOptionResponse { - id: Snowflake; - title: string; - description: string; - emoji: SettingsEmojiResponse; - role_ids: Array<Snowflake>; - channel_ids: Array<Snowflake>; -} - -export interface OnboardingPromptResponse { - id: Snowflake; - title: string; - options: Array<OnboardingPromptOptionResponse>; - single_select: boolean; - required: boolean; - in_onboarding: boolean; - type: OnboardingPromptType; -} - -export type OnboardingPromptType = (0 | 1); - -export interface ParagraphFormFieldResponse { - field_type: (GuildMemberVerificationFormFieldType); - label?: string; - description?: string; - required?: boolean; - placeholder?: string; - response?: string; -} - -export interface PartialDiscordIntegrationResponse { - id: Snowflake; - type: (IntegrationTypes); - name: (string | null); - account: AccountResponse; - application_id: Snowflake; -} - -export interface PartialExternalConnectionIntegrationResponse { - id: Snowflake; - type: (IntegrationTypes); - name: (string | null); - account: AccountResponse; -} - -export interface PartialGuildSubscriptionIntegrationResponse { - id: Snowflake; - type: (IntegrationTypes); - name: (string | null); - account: AccountResponse; -} - -export interface PinnedMessageResponse { - pinned_at: string; - message: MessageResponse; -} - -export interface PinnedMessagesResponse { - items: Array<PinnedMessageResponse>; - has_more: boolean; -} - -export interface PollAnswerCreateRequest { - poll_media: PollMediaCreateRequest; -} - -export interface PollAnswerDetailsResponse { - users: Array<UserResponse>; -} - -export interface PollAnswerResponse { - answer_id: number; - poll_media: PollMediaResponse; -} - -export interface PollCreateRequest { - question: PollMedia; - answers: Array<PollAnswerCreateRequest>; - allow_multiselect?: (boolean | null); - layout_type?: (null | PollLayoutTypes); - duration?: (number | null); -} - -export interface PollEmoji { - id?: (null | Snowflake); - name?: (string | null); - animated?: (boolean | null); -} - -export interface PollEmojiCreateRequest { - id?: (null | Snowflake); - name?: (string | null); - animated?: (boolean | null); -} - -export type PollLayoutTypes = (1); - -export interface PollMedia { - text?: (string | null); - emoji?: (null | PollEmoji); -} - -export interface PollMediaCreateRequest { - text?: (string | null); - emoji?: (null | PollEmojiCreateRequest); -} - -export interface PollMediaResponse { - text?: string; - emoji?: MessageReactionEmojiResponse; -} - -export interface PollResponse { - question: PollMediaResponse; - answers: Array<PollAnswerResponse>; - expiry: string; - allow_multiselect: boolean; - layout_type: PollLayoutTypes; - results: PollResultsResponse; -} - -export interface PollResultsEntryResponse { - id: number; - count: number; - me_voted: boolean; -} - -export interface PollResultsResponse { - answer_counts: Array<PollResultsEntryResponse>; - is_finalized: boolean; -} - -export interface PongInteractionCallbackRequest { - type: (InteractionCallbackTypes); -} - -export type PremiumGuildTiers = (0 | 1 | 2 | 3); - -export type PremiumTypes = (0 | 1 | 2 | 3); - -export interface PrivateApplicationResponse { - id: Snowflake; - name: string; - icon: (string | null); - description: string; - type: (null | ApplicationTypes); - cover_image?: string; - primary_sku_id?: Snowflake; - bot?: UserResponse; - slug?: string; - guild_id?: Snowflake; - rpc_origins?: Array<string>; - bot_public?: boolean; - bot_require_code_grant?: boolean; - terms_of_service_url?: string; - privacy_policy_url?: string; - custom_install_url?: string; - install_params?: ApplicationOAuth2InstallParamsResponse; - integration_types_config?: { - [key: string]: ApplicationIntegrationTypeConfigurationResponse; -}; - verify_key: string; - flags: number; - flags_new: string; - max_participants?: (number | null); - tags?: Array<string>; - redirect_uris: Array<string>; - interactions_endpoint_url: (string | null); - role_connections_verification_url: (string | null); - owner: UserResponse; - approximate_guild_count: number; - approximate_user_install_count: number; - approximate_user_authorization_count: number; - event_webhooks_url?: (string | null); - event_webhooks_status?: ApplicationEventWebhooksStatus; - event_webhooks_types?: Array<(ActionTypes)>; - explicit_content_filter: ApplicationExplicitContentFilterTypes; - team: (null | TeamResponse); -} - -export interface PrivateChannelLocation { - id: string; - kind: (EmbeddedActivityLocationKind); - channel_id: Snowflake; -} - -export interface PrivateChannelResponse { - id: Snowflake; - type: (ChannelTypes); - last_message_id?: (null | Snowflake); - flags: number; - last_pin_timestamp?: (string | null); - recipients: Array<UserResponse>; -} - -export interface PrivateGroupChannelResponse { - id: Snowflake; - type: (ChannelTypes); - last_message_id?: (null | Snowflake); - flags: number; - last_pin_timestamp?: (string | null); - recipients: Array<UserResponse>; - name: (string | null); - icon: (string | null); - owner_id: Snowflake; - managed?: boolean; - application_id?: Snowflake; -} - -export interface PrivateGuildMemberResponse { - avatar: (string | null); - avatar_decoration_data?: (null | UserAvatarDecorationResponse); - banner: (string | null); - communication_disabled_until: (string | null); - flags: number; - joined_at: string; - nick: (string | null); - pending: boolean; - premium_since: (string | null); - roles: Array<Snowflake>; - collectibles?: (null | UserCollectiblesResponse); - user: UserResponse; - mute: boolean; - deaf: boolean; - permissions?: string; -} - -export interface ProvisionalTokenResponse { - token_type: string; - access_token: string; - expires_in: number; - scope: string; - id_token: string; - refresh_token?: (string | null); - scopes?: (Array<string> | null); - expires_at_s?: (number | null); -} - -export interface PruneGuildRequest { - days?: (number | null); - compute_prune_count?: (boolean | null); - include_roles?: (string | Array<Snowflake> | null); -} - -export interface PurchaseNotificationResponse { - type: PurchaseType; - guild_product_purchase?: GuildProductPurchaseResponse; -} - -export type PurchaseType = (0); - -export interface QuarantineUserAction { - type: (AutomodActionType); - metadata?: (null | QuarantineUserActionMetadata); -} - -export interface QuarantineUserActionMetadata {} - -export interface QuarantineUserActionMetadataResponse {} - -export interface QuarantineUserActionResponse { - type: (AutomodActionType); - metadata: QuarantineUserActionMetadataResponse; -} - -export interface RadioGroupComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - required?: (boolean | null); - options: Array<RadioGroupOptionForRequest>; -} - -export interface RadioGroupOptionForRequest { - label: string; - value: string; - description?: (string | null); - default?: (boolean | null); -} - -export type ReactionTypes = (0 | 1); - -export interface RecurrenceRule { - start: string; - end?: (string | null); - frequency: RecurrenceRuleFrequencies; - interval?: (number | null); - by_weekday?: (Array<RecurrenceRuleWeekdays> | null); - by_n_weekday?: (Array<ByNWeekday> | null); - by_month?: (Array<RecurrenceRuleMonths> | null); - by_month_day?: (Array<number> | null); - by_year_day?: (Array<number> | null); - count?: (number | null); -} - -export type RecurrenceRuleFrequencies = (3 | 2 | 1 | 0); - -export type RecurrenceRuleMonths = (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12); - -export interface RecurrenceRuleResponse { - start: string; - end?: (string | null); - frequency: RecurrenceRuleFrequencies; - interval: number; - by_weekday: (Array<RecurrenceRuleWeekdays> | null); - by_n_weekday: (Array<ByNWeekdayResponse> | null); - by_month: (Array<RecurrenceRuleMonths> | null); - by_month_day: (Array<number> | null); - by_year_day?: (Array<number> | null); - count?: (number | null); -} - -export type RecurrenceRuleWeekdays = (0 | 1 | 2 | 3 | 4 | 5 | 6); - -export interface ResolvedObjectsResponse { - users?: ({ - [key: string]: UserResponse; -} | null); - members?: ({ - [key: string]: BasicGuildMemberResponse; -} | null); - channels?: ({ - [key: string]: (GuildChannelResponse | PrivateChannelResponse | PrivateGroupChannelResponse | ThreadResponse); -} | null); - roles?: ({ - [key: string]: GuildRoleResponse; -} | null); -} - -export interface ResourceChannelResponse { - channel_id: Snowflake; - title: string; - emoji?: SettingsEmojiResponse; - icon?: string; - description: string; -} - -export interface RichEmbed { - type?: (string | null); - url?: (string | null); - title?: (string | null); - color?: (number | null); - timestamp?: (string | null); - description?: (string | null); - author?: (null | RichEmbedAuthor); - image?: (null | RichEmbedImage); - thumbnail?: (null | RichEmbedThumbnail); - footer?: (null | RichEmbedFooter); - fields?: (Array<RichEmbedField> | null); - provider?: (null | RichEmbedProvider); - video?: (null | RichEmbedVideo); -} - -export interface RichEmbedAuthor { - name?: (string | null); - url?: (string | null); - icon_url?: (string | null); -} - -export interface RichEmbedField { - name: string; - value: string; - inline?: (boolean | null); -} - -export interface RichEmbedFooter { - text?: (string | null); - icon_url?: (string | null); -} - -export interface RichEmbedImage { - url?: (string | null); - width?: (number | null); - height?: (number | null); - placeholder?: (string | null); - placeholder_version?: (number | null); - is_animated?: (boolean | null); - description?: (string | null); -} - -export interface RichEmbedProvider { - name?: (string | null); - url?: (string | null); -} - -export interface RichEmbedThumbnail { - url?: (string | null); - width?: (number | null); - height?: (number | null); - placeholder?: (string | null); - placeholder_version?: (number | null); - is_animated?: (boolean | null); - description?: (string | null); -} - -export interface RichEmbedVideo { - url?: (string | null); - width?: (number | null); - height?: (number | null); - placeholder?: (string | null); - placeholder_version?: (number | null); - is_animated?: (boolean | null); - description?: (string | null); -} - -export interface RoleColors { - primary_color?: (number | null); - secondary_color?: (number | null); - tertiary_color?: (number | null); -} - -export interface RoleSelectComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - placeholder?: (string | null); - min_values?: (number | null); - max_values?: (number | null); - disabled?: (boolean | null); - required?: (boolean | null); - default_values?: (Array<RoleSelectDefaultValue> | null); -} - -export interface RoleSelectComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - placeholder?: (string | null); - min_values?: (number | null); - max_values?: (number | null); - disabled?: (boolean | null); - required?: (boolean | null); - default_values?: (Array<RoleSelectDefaultValue> | null); -} - -export interface RoleSelectComponentResponse { - type: (MessageComponentTypes); - id: number; - custom_id: string; - placeholder?: string; - min_values: number; - max_values: number; - disabled?: boolean; - default_values?: Array<RoleSelectDefaultValueResponse>; -} - -export interface RoleSelectDefaultValue { - type: (Snowflake); - id: Snowflake; -} - -export interface RoleSelectDefaultValueResponse { - type: (Snowflake); - id: Snowflake; -} - -export interface SDKMessageRequest { - content?: (string | null); - embeds?: (Array<RichEmbed> | null); - allowed_mentions?: (null | MessageAllowedMentionsRequest); - sticker_ids?: (Array<Snowflake> | null); - components?: (Array<(ActionRowComponentForMessageRequest | ContainerComponentForMessageRequest | FileComponentForMessageRequest | MediaGalleryComponentForMessageRequest | SectionComponentForMessageRequest | SeparatorComponentForMessageRequest | TextDisplayComponentForMessageRequest)> | null); - flags?: (number | null); - attachments?: (Array<MessageAttachmentRequest> | null); - poll?: (null | PollCreateRequest); - shared_client_theme?: (null | CustomClientThemeShareRequest); - message_reference?: (null | MessageReferenceRequest); - nonce?: (number | string | null); - enforce_nonce?: (boolean | null); - tts?: (boolean | null); -} - -export type SKUIneligibilityReason = (0 | 1 | 2); - -export interface ScheduledEventResponse { - id: Snowflake; - guild_id: Snowflake; - name: string; - description: (string | null); - channel_id: (null | Snowflake); - creator_id: (null | Snowflake); - creator?: UserResponse; - image: (string | null); - scheduled_start_time: string; - scheduled_end_time: (string | null); - status: GuildScheduledEventStatuses; - entity_type: GuildScheduledEventEntityTypes; - entity_id: (null | Snowflake); - recurrence_rule: (null | RecurrenceRuleResponse); - user_count?: number; - privacy_level: GuildScheduledEventPrivacyLevels; - user_rsvp?: (null | ScheduledEventUserResponse); - guild_scheduled_event_exceptions: Array<GuildScheduledEventExceptionResponse>; -} - -export interface ScheduledEventUserCountResponse { - guild_scheduled_event_count: number; - guild_scheduled_event_exception_counts: { - [key: string]: number; -}; -} - -export interface ScheduledEventUserResponse { - guild_scheduled_event_id: Snowflake; - guild_scheduled_event_exception_id?: (null | Snowflake); - user_id: Snowflake; - user?: UserResponse; - member?: GuildMemberResponse; - response: GuildScheduledEventUserResponses; -} - -export interface SearchIndexNotReadyResponse { - message: string; - code: number; - documents_indexed: number; - retry_after: number; -} - -export interface SearchMessageResponse { - type: MessageType; - content: string; - mentions: Array<UserResponse>; - mention_roles: Array<Snowflake>; - attachments: Array<MessageAttachmentResponse>; - embeds: Array<MessageEmbedResponse>; - timestamp: string; - edited_timestamp: (string | null); - flags: number; - components: Array<(ActionRowComponentResponse | ContainerComponentResponse | FileComponentResponse | MediaGalleryComponentResponse | SectionComponentResponse | SeparatorComponentResponse | TextDisplayComponentResponse)>; - stickers?: Array<(GuildStickerResponse | StandardStickerResponse)>; - sticker_items?: Array<MessageStickerItemResponse>; - id: Snowflake; - channel_id: Snowflake; - author: UserResponse; - pinned: boolean; - mention_everyone: boolean; - tts: boolean; - call?: MessageCallResponse; - activity?: MessageActivityResponse; - application?: BasicApplicationResponseWithBot; - application_id?: Snowflake; - interaction?: MessageInteractionResponse; - nonce?: (number | string); - webhook_id?: Snowflake; - message_reference?: MessageReferenceResponse; - thread?: ThreadResponse; - mention_channels?: Array<MessageMentionChannelResponse>; - role_subscription_data?: MessageRoleSubscriptionDataResponse; - purchase_notification?: PurchaseNotificationResponse; - position?: number; - resolved?: ResolvedObjectsResponse; - poll?: PollResponse; - shared_client_theme?: CustomClientThemeResponse; - interaction_metadata?: (ApplicationCommandInteractionMetadataResponse | MessageComponentInteractionMetadataResponse | ModalSubmitInteractionMetadataResponse); - message_snapshots?: Array<MessageSnapshotResponse>; - reactions?: Array<MessageReactionResponse>; - referenced_message?: (null | BasicMessageResponse); - hit: boolean; -} - -export type SearchableEmbedType = ('image' | 'video' | 'gif' | 'sound' | 'article'); - -export interface SectionComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - components: Array<TextDisplayComponentForMessageRequest>; - accessory: (ButtonComponentForMessageRequest | ThumbnailComponentForMessageRequest); -} - -export interface SectionComponentResponse { - type: (MessageComponentTypes); - id: number; - components: Array<TextDisplayComponentResponse>; - accessory: (ButtonComponentResponse | ThumbnailComponentResponse); -} - -export interface SeparatorComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - spacing?: (null | MessageComponentSeparatorSpacingSize); - divider?: (boolean | null); -} - -export interface SeparatorComponentResponse { - type: (MessageComponentTypes); - id: number; - spacing: MessageComponentSeparatorSpacingSize; - divider: boolean; -} - -export interface SettingsEmojiResponse { - id: (null | Snowflake); - name: (string | null); - animated: boolean; -} - -export interface SlackWebhook { - text?: (string | null); - username?: (string | null); - icon_url?: (string | null); - attachments?: (Array<WebhookSlackEmbed> | null); -} - -export type SnowflakeSelectDefaultValueTypes = ('user' | 'role' | 'channel'); - -export type SnowflakeType = Snowflake; - -export interface SocialLayerSKUPurchaseEligibilityCallbackData { - eligible: boolean; - ineligible_reason?: (null | SKUIneligibilityReason); - ineligible_reason_description?: (string | null); -} - -export interface SocialLayerSKUPurchaseEligibilityInteractionCallbackRequest { - type: (InteractionCallbackTypes); - data: SocialLayerSKUPurchaseEligibilityCallbackData; -} - -export type SortingMode = ('relevance' | 'timestamp'); - -export type SortingOrder = ('asc' | 'desc'); - -export interface SoundboardCreateRequest { - name: string; - volume?: (number | null); - emoji_id?: (null | Snowflake); - emoji_name?: (string | null); - sound: string; -} - -export interface SoundboardPatchRequestPartial { - name?: string; - volume?: (number | null); - emoji_id?: (null | Snowflake); - emoji_name?: (string | null); -} - -export interface SoundboardSoundResponse { - name: string; - sound_id: Snowflake; - volume: number; - emoji_id: (null | Snowflake); - emoji_name: (string | null); - guild_id?: Snowflake; - available: boolean; - user?: UserResponse; -} - -export interface SoundboardSoundSendRequest { - sound_id: Snowflake; - source_guild_id?: (null | Snowflake); -} - -export interface StageInstanceResponse { - guild_id: Snowflake; - channel_id: Snowflake; - topic: string; - privacy_level: StageInstancesPrivacyLevels; - id: Snowflake; - discoverable_disabled: boolean; - guild_scheduled_event_id: (null | Snowflake); -} - -export type StageInstancesPrivacyLevels = (1 | 2); - -export interface StageScheduledEventCreateRequest { - name: string; - description?: (string | null); - image?: (string | null); - scheduled_start_time: string; - scheduled_end_time?: (string | null); - privacy_level: GuildScheduledEventPrivacyLevels; - entity_type: (GuildScheduledEventEntityTypes); - channel_id?: (null | Snowflake); - recurrence_rule?: (null | RecurrenceRule); - entity_metadata?: (null | EntityMetadataStageInstance); -} - -export interface StageScheduledEventPatchRequestPartial { - status?: (null | GuildScheduledEventStatuses); - name?: string; - description?: (string | null); - image?: (string | null); - scheduled_start_time?: string; - scheduled_end_time?: (string | null); - entity_type?: (null | (GuildScheduledEventEntityTypes)); - privacy_level?: GuildScheduledEventPrivacyLevels; - channel_id?: (null | Snowflake); - recurrence_rule?: (null | RecurrenceRule); - entity_metadata?: (null | EntityMetadataStageInstance); -} - -export interface StageScheduledEventResponse { - id: Snowflake; - guild_id: Snowflake; - name: string; - description: (string | null); - channel_id: (null | Snowflake); - creator_id: (null | Snowflake); - creator?: UserResponse; - image: (string | null); - scheduled_start_time: string; - scheduled_end_time: (string | null); - status: GuildScheduledEventStatuses; - entity_type: (GuildScheduledEventEntityTypes); - entity_id: (null | Snowflake); - recurrence_rule: (null | RecurrenceRuleResponse); - user_count?: number; - privacy_level: GuildScheduledEventPrivacyLevels; - user_rsvp?: (null | ScheduledEventUserResponse); - guild_scheduled_event_exceptions: Array<GuildScheduledEventExceptionResponse>; - entity_metadata: (null | EntityMetadataStageInstanceResponse); -} - -export interface StandardStickerResponse { - id: Snowflake; - name: string; - tags: string; - type: (StickerTypes); - format_type: (null | StickerFormatTypes); - description: (string | null); - pack_id: Snowflake; - sort_value: number; -} - -export type StickerFormatTypes = (1 | 2 | 3 | 4); - -export interface StickerPackCollectionResponse { - sticker_packs: Array<StickerPackResponse>; -} - -export interface StickerPackResponse { - id: Snowflake; - sku_id: Snowflake; - name: string; - description: (string | null); - stickers: Array<StandardStickerResponse>; - cover_sticker_id?: Snowflake; - banner_asset_id?: Snowflake; -} - -export type StickerTypes = (1 | 2); - -export interface StringSelectComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - placeholder?: (string | null); - min_values?: (number | null); - max_values?: (number | null); - disabled?: (boolean | null); - required?: (boolean | null); - options: Array<StringSelectOptionForRequest>; -} - -export interface StringSelectComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - placeholder?: (string | null); - min_values?: (number | null); - max_values?: (number | null); - disabled?: (boolean | null); - required?: (boolean | null); - options: Array<StringSelectOptionForRequest>; -} - -export interface StringSelectComponentResponse { - type: (MessageComponentTypes); - id: number; - custom_id: string; - placeholder?: string; - min_values: number; - max_values: number; - disabled?: boolean; - options: Array<StringSelectOptionResponse>; -} - -export interface StringSelectOptionForRequest { - label: string; - value: string; - description?: (string | null); - default?: (boolean | null); - emoji?: (null | ComponentEmojiForRequest); -} - -export interface StringSelectOptionResponse { - label: string; - value: string; - description?: string; - emoji?: ComponentEmojiResponse; - default?: boolean; -} - -export interface SubscriptionResponse { - id: Snowflake; - user_id: Snowflake; - sku_ids: Array<Snowflake>; - renewal_sku_ids: (Array<Snowflake> | null); - entitlement_ids: Array<Snowflake>; - current_period_start: string; - current_period_end: string; - status: SubscriptionResponseStatusType; - canceled_at: (string | null); - country?: (string | null); -} - -export type SubscriptionResponseStatusType = (0 | 1 | 2); - -export interface TargetUsersJobStatusResponse { - status: TargetUsersJobStatusTypes; - total_users: UInt32Type; - processed_users: UInt32Type; - created_at: (string | null); - completed_at: (string | null); - error_message: (string | null); -} - -export type TargetUsersJobStatusTypes = (0 | 1 | 2 | 3); - -export interface TeamMemberResponse { - user: UserResponse; - team_id: Snowflake; - membership_state: TeamMembershipStates; - role: TeamMemberRoles; - permissions: Array<string>; -} - -export type TeamMemberRoles = ('admin' | 'developer' | 'read_only'); - -export type TeamMembershipStates = (1 | 2); - -export interface TeamResponse { - id: Snowflake; - icon: (string | null); - name: string; - owner_user_id: Snowflake; - members: Array<TeamMemberResponse>; -} - -export interface TermsFormFieldResponse { - field_type: (GuildMemberVerificationFormFieldType); - label?: string; - description?: string; - required?: boolean; - values: Array<string>; - response?: boolean; -} - -export interface TextDisplayComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - content: string; -} - -export interface TextDisplayComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - content: string; -} - -export interface TextDisplayComponentResponse { - type: (MessageComponentTypes); - id: number; - content: string; -} - -export interface TextInputComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - style: TextInputStyleTypes; - label?: (string | null); - value?: (string | null); - placeholder?: (string | null); - required?: (boolean | null); - min_length?: (number | null); - max_length?: (number | null); -} - -export interface TextInputComponentResponse { - type: (MessageComponentTypes); - id: number; - custom_id: string; - style: TextInputStyleTypes; - label: (string | null); - value?: string; - placeholder?: string; - required?: boolean; - min_length: (number | null); - max_length: (number | null); -} - -export interface TextInputFormFieldResponse { - field_type: (GuildMemberVerificationFormFieldType); - label?: string; - description?: string; - required?: boolean; - placeholder?: string; - response?: string; -} - -export type TextInputStyleTypes = (1 | 2); - -export type ThreadAutoArchiveDuration = (60 | 1440 | 4320 | 10080); - -export interface ThreadMemberResponse { - id: Snowflake; - user_id: Snowflake; - join_timestamp: string; - flags: number; - member?: GuildMemberResponse; -} - -export interface ThreadMetadataResponse { - archived: boolean; - archive_timestamp: (string | null); - auto_archive_duration: ThreadAutoArchiveDuration; - locked: boolean; - create_timestamp?: string; - invitable?: boolean; -} - -export interface ThreadResponse { - id: Snowflake; - type: (ChannelTypes); - last_message_id?: (null | Snowflake); - flags: number; - last_pin_timestamp?: (string | null); - guild_id: Snowflake; - name: string; - parent_id?: (null | Snowflake); - rate_limit_per_user?: number; - bitrate?: number; - user_limit?: number; - rtc_region?: (string | null); - video_quality_mode?: VideoQualityModes; - permissions?: string; - owner_id: Snowflake; - thread_metadata: ThreadMetadataResponse; - message_count: number; - member_count: number; - total_message_sent: number; - applied_tags?: Array<Snowflake>; - member?: ThreadMemberResponse; -} - -export interface ThreadSearchResponse { - threads: Array<ThreadResponse>; - members: Array<ThreadMemberResponse>; - has_more: boolean; - first_messages?: Array<MessageResponse>; - total_results: number; -} - -export type ThreadSearchTagSetting = ('match_all' | 'match_some'); - -export type ThreadSortOrder = (0 | 1); - -export type ThreadSortingMode = ('relevance' | 'creation_time' | 'last_message_time' | 'archive_time'); - -export interface ThreadsResponse { - threads: Array<ThreadResponse>; - members: Array<ThreadMemberResponse>; - has_more: boolean; - first_messages?: Array<MessageResponse>; -} - -export interface ThumbnailComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - description?: (string | null); - spoiler?: (boolean | null); - media: UnfurledMediaRequest; -} - -export interface ThumbnailComponentResponse { - type: (MessageComponentTypes); - id: number; - media: UnfurledMediaResponse; - description: (string | null); - spoiler: boolean; -} - -export interface TypingIndicatorResponse {} - -export type UInt32Type = number; - -export interface UnbanUserFromGuildRequest {} - -export interface UnfurledMediaRequest { - url: string; -} - -export interface UnfurledMediaRequestWithAttachmentReferenceRequired { - url: string; -} - -export interface UnfurledMediaResponse { - id: Snowflake; - url: string; - proxy_url: string; - width?: (number | null); - height?: (number | null); - content_type?: (string | null); - attachment_id?: Snowflake; -} - -export interface UpdateApplicationUserRoleConnectionRequest { - platform_name?: (string | null); - platform_username?: (string | null); - metadata?: ({ - [key: string]: string; -} | null); -} - -export interface UpdateDMRequestPartial { - name?: (string | null); -} - -export interface UpdateDefaultReactionEmojiRequest { - emoji_id?: (null | Snowflake); - emoji_name?: (string | null); -} - -export interface UpdateGroupDMRequestPartial { - name?: (string | null); - icon?: (string | null); -} - -export interface UpdateGuildChannelRequestPartial { - type?: (null | (ChannelTypes)); - name?: string; - position?: (number | null); - topic?: (string | null); - bitrate?: (number | null); - user_limit?: (number | null); - nsfw?: (boolean | null); - rate_limit_per_user?: (number | null); - parent_id?: (null | Snowflake); - permission_overwrites?: (Array<ChannelPermissionOverwriteRequest> | null); - rtc_region?: (string | null); - video_quality_mode?: (null | VideoQualityModes); - default_auto_archive_duration?: (null | ThreadAutoArchiveDuration); - default_reaction_emoji?: (null | UpdateDefaultReactionEmojiRequest); - default_thread_rate_limit_per_user?: (number | null); - default_sort_order?: (null | ThreadSortOrder); - default_forum_layout?: (null | ForumLayout); - default_tag_setting?: (null | ThreadSearchTagSetting); - flags?: (number | null); - available_tags?: (Array<UpdateThreadTagRequest> | null); -} - -export interface UpdateGuildOnboardingRequest { - prompts?: (Array<UpdateOnboardingPromptRequest> | null); - enabled?: (boolean | null); - default_channel_ids?: (Array<Snowflake> | null); - mode?: (null | GuildOnboardingMode); -} - -export interface UpdateMessageInteractionCallbackRequest { - type: (InteractionCallbackTypes); - data?: (null | IncomingWebhookUpdateForInteractionCallbackRequestPartial); -} - -export interface UpdateMessageInteractionCallbackResponse { - type: (InteractionCallbackTypes); - message: MessageResponse; -} - -export interface UpdateOnboardingPromptRequest { - title: string; - options: Array<OnboardingPromptOptionRequest>; - single_select?: (boolean | null); - required?: (boolean | null); - in_onboarding?: (boolean | null); - type?: (null | OnboardingPromptType); - id: Snowflake; -} - -export interface UpdateRolePositionsRequest { - id?: (null | Snowflake); - position?: (number | null); -} - -export interface UpdateRoleRequestPartial { - name?: (string | null); - permissions?: (number | null); - color?: (number | null); - colors?: (null | RoleColors); - hoist?: (boolean | null); - mentionable?: (boolean | null); - icon?: (string | null); - unicode_emoji?: (string | null); -} - -export interface UpdateSelfVoiceStateRequestPartial { - request_to_speak_timestamp?: (string | null); - suppress?: (boolean | null); - channel_id?: (null | Snowflake); -} - -export interface UpdateThreadRequestPartial { - name?: (string | null); - archived?: (boolean | null); - locked?: (boolean | null); - invitable?: (boolean | null); - auto_archive_duration?: (null | ThreadAutoArchiveDuration); - rate_limit_per_user?: (number | null); - flags?: (number | null); - applied_tags?: (Array<Snowflake> | null); - bitrate?: (number | null); - user_limit?: (number | null); - rtc_region?: (string | null); - video_quality_mode?: (null | VideoQualityModes); -} - -export interface UpdateThreadTagRequest { - name: string; - emoji_id?: (null | Snowflake); - emoji_name?: (string | null); - moderated?: (boolean | null); - id?: (null | Snowflake); -} - -export interface UpdateVoiceStateRequestPartial { - suppress?: (boolean | null); - channel_id?: (null | Snowflake); -} - -export interface UserAvatarDecorationResponse { - asset: string; - sku_id: (null | Snowflake); -} - -export interface UserCollectiblesResponse { - nameplate: (null | UserNameplateResponse); -} - -export interface UserCommunicationDisabledAction { - type: (AutomodActionType); - metadata: UserCommunicationDisabledActionMetadata; -} - -export interface UserCommunicationDisabledActionMetadata { - duration_seconds?: (number | null); -} - -export interface UserCommunicationDisabledActionMetadataResponse { - duration_seconds: number; -} - -export interface UserCommunicationDisabledActionResponse { - type: (AutomodActionType); - metadata: UserCommunicationDisabledActionMetadataResponse; -} - -export interface UserGuildOnboardingResponse { - guild_id: Snowflake; - prompts: Array<OnboardingPromptResponse>; - default_channel_ids: Array<Snowflake>; - enabled: boolean; - mode: GuildOnboardingMode; -} - -export interface UserNameplateResponse { - sku_id: (null | Snowflake); - asset: string; - label: string; - palette: NameplatePalette; -} - -export type UserNotificationSettings = (0 | 1); - -export interface UserPIIResponse { - id: Snowflake; - username: string; - avatar: (string | null); - discriminator: string; - public_flags: number; - flags: Int53Type; - bot?: boolean; - system?: boolean; - banner?: (string | null); - accent_color?: (number | null); - global_name: (string | null); - avatar_decoration_data?: (null | UserAvatarDecorationResponse); - collectibles?: (null | UserCollectiblesResponse); - primary_guild?: (null | UserPrimaryGuildResponse); - mfa_enabled: boolean; - locale: AvailableLocalesEnum; - premium_type?: PremiumTypes; - email?: (string | null); - verified?: boolean; -} - -export interface UserPrimaryGuildResponse { - identity_guild_id: (null | Snowflake); - identity_enabled: (boolean | null); - tag: (string | null); - badge: (string | null); -} - -export interface UserProfileMetadata { - keyword_filter?: (Array<string> | null); - regex_patterns?: (Array<string> | null); - allow_list?: (Array<string> | null); -} - -export interface UserProfileMetadataResponse { - keyword_filter: Array<string>; - regex_patterns: Array<string>; - allow_list: Array<string>; -} - -export interface UserProfileRuleResponse { - id: Snowflake; - guild_id: Snowflake; - creator_id: Snowflake; - name: string; - event_type: AutomodEventType; - actions: Array<(BlockMessageActionResponse | FlagToChannelActionResponse | QuarantineUserActionResponse | UserCommunicationDisabledActionResponse)>; - trigger_type: (AutomodTriggerType); - enabled: boolean; - exempt_roles: Array<Snowflake>; - exempt_channels: Array<Snowflake>; - trigger_metadata: UserProfileMetadataResponse; -} - -export interface UserProfileUpsertRequest { - name: string; - event_type: AutomodEventType; - actions?: (Array<(BlockMessageAction | FlagToChannelAction | QuarantineUserAction | UserCommunicationDisabledAction)> | null); - enabled?: (boolean | null); - exempt_roles?: (Array<Snowflake> | null); - exempt_channels?: (Array<Snowflake> | null); - trigger_type: (AutomodTriggerType); - trigger_metadata: UserProfileMetadata; -} - -export interface UserProfileUpsertRequestPartial { - name?: string; - event_type?: AutomodEventType; - actions?: (Array<(BlockMessageAction | FlagToChannelAction | QuarantineUserAction | UserCommunicationDisabledAction)> | null); - enabled?: (boolean | null); - exempt_roles?: (Array<Snowflake> | null); - exempt_channels?: (Array<Snowflake> | null); - trigger_type?: (AutomodTriggerType); - trigger_metadata?: UserProfileMetadata; -} - -export interface UserResponse { - id: Snowflake; - username: string; - avatar: (string | null); - discriminator: string; - public_flags: number; - flags: Int53Type; - bot?: boolean; - system?: boolean; - banner?: (string | null); - accent_color?: (number | null); - global_name: (string | null); - avatar_decoration_data?: (null | UserAvatarDecorationResponse); - collectibles?: (null | UserCollectiblesResponse); - primary_guild: (null | UserPrimaryGuildResponse); -} - -export interface UserSelectComponentForMessageRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - placeholder?: (string | null); - min_values?: (number | null); - max_values?: (number | null); - disabled?: (boolean | null); - required?: (boolean | null); - default_values?: (Array<UserSelectDefaultValue> | null); -} - -export interface UserSelectComponentForModalRequest { - type: (MessageComponentTypes); - id?: (number | null); - custom_id: string; - placeholder?: (string | null); - min_values?: (number | null); - max_values?: (number | null); - disabled?: (boolean | null); - required?: (boolean | null); - default_values?: (Array<UserSelectDefaultValue> | null); -} - -export interface UserSelectComponentResponse { - type: (MessageComponentTypes); - id: number; - custom_id: string; - placeholder?: string; - min_values: number; - max_values: number; - disabled?: boolean; - default_values?: Array<UserSelectDefaultValueResponse>; -} - -export interface UserSelectDefaultValue { - type: (Snowflake); - id: Snowflake; -} - -export interface UserSelectDefaultValueResponse { - type: (Snowflake); - id: Snowflake; -} - -export interface VanityURLErrorResponse { - message: string; - code: number; -} - -export interface VanityURLResponse { - code: (string | null); - uses: number; - error?: (null | VanityURLErrorResponse); -} - -export type VerificationLevels = (0 | 1 | 2 | 3 | 4); - -export type VideoQualityModes = (1 | 2); - -export interface VoiceRegionResponse { - id: string; - name: string; - custom: boolean; - deprecated: boolean; - optimal: boolean; -} - -export interface VoiceScheduledEventCreateRequest { - name: string; - description?: (string | null); - image?: (string | null); - scheduled_start_time: string; - scheduled_end_time?: (string | null); - privacy_level: GuildScheduledEventPrivacyLevels; - entity_type: (GuildScheduledEventEntityTypes); - channel_id?: (null | Snowflake); - recurrence_rule?: (null | RecurrenceRule); - entity_metadata?: (null | EntityMetadataVoice); -} - -export interface VoiceScheduledEventPatchRequestPartial { - status?: (null | GuildScheduledEventStatuses); - name?: string; - description?: (string | null); - image?: (string | null); - scheduled_start_time?: string; - scheduled_end_time?: (string | null); - entity_type?: (null | (GuildScheduledEventEntityTypes)); - privacy_level?: GuildScheduledEventPrivacyLevels; - channel_id?: (null | Snowflake); - recurrence_rule?: (null | RecurrenceRule); - entity_metadata?: (null | EntityMetadataVoice); -} - -export interface VoiceScheduledEventResponse { - id: Snowflake; - guild_id: Snowflake; - name: string; - description: (string | null); - channel_id: (null | Snowflake); - creator_id: (null | Snowflake); - creator?: UserResponse; - image: (string | null); - scheduled_start_time: string; - scheduled_end_time: (string | null); - status: GuildScheduledEventStatuses; - entity_type: (GuildScheduledEventEntityTypes); - entity_id: (null | Snowflake); - recurrence_rule: (null | RecurrenceRuleResponse); - user_count?: number; - privacy_level: GuildScheduledEventPrivacyLevels; - user_rsvp?: (null | ScheduledEventUserResponse); - guild_scheduled_event_exceptions: Array<GuildScheduledEventExceptionResponse>; - entity_metadata: (null | EntityMetadataVoiceResponse); -} - -export interface VoiceStateResponse { - channel_id: (null | Snowflake); - deaf: boolean; - guild_id: (null | Snowflake); - member?: GuildMemberResponse; - mute: boolean; - request_to_speak_timestamp: (string | null); - suppress: boolean; - self_stream: (boolean | null); - self_deaf: boolean; - self_mute: boolean; - self_video: boolean; - session_id: string; - user_id: Snowflake; -} - -export interface WebhookSlackEmbed { - title?: (string | null); - title_link?: (string | null); - text?: (string | null); - color?: (string | null); - ts?: (number | null); - pretext?: (string | null); - footer?: (string | null); - footer_icon?: (string | null); - author_name?: (string | null); - author_link?: (string | null); - author_icon?: (string | null); - image_url?: (string | null); - thumb_url?: (string | null); - fields?: (Array<WebhookSlackEmbedField> | null); -} - -export interface WebhookSlackEmbedField { - name?: (string | null); - value?: (string | null); - inline?: (boolean | null); -} - -export interface WebhookSourceChannelResponse { - id: Snowflake; - name: string; -} - -export interface WebhookSourceGuildResponse { - id: Snowflake; - icon: (string | null); - name: string; -} - -export type WebhookTypes = (1 | 2 | 3); - -export interface WelcomeMessageResponse { - author_ids: Array<Snowflake>; - message: string; -} - -export interface WelcomeScreenPatchRequestPartial { - description?: (string | null); - welcome_channels?: (Array<GuildWelcomeChannel> | null); - enabled?: (boolean | null); -} - -export interface WidgetActivity { - name: string; -} - -export interface WidgetChannel { - id: Snowflake; - name: string; - position: number; -} - -export type WidgetImageStyles = ('shield' | 'banner1' | 'banner2' | 'banner3' | 'banner4'); - -export interface WidgetMember { - id: string; - username: string; - discriminator: WidgetUserDiscriminator; - avatar: null; - status: string; - avatar_url: string; - activity?: WidgetActivity; - deaf?: boolean; - mute?: boolean; - self_deaf?: boolean; - self_mute?: boolean; - suppress?: boolean; - channel_id?: Snowflake; -} - -export interface WidgetResponse { - id: Snowflake; - name: string; - instant_invite: (string | null); - channels: Array<WidgetChannel>; - members: Array<WidgetMember>; - presence_count: number; -} - -export interface WidgetSettingsResponse { - enabled: boolean; - channel_id: (null | Snowflake); -} - -export type WidgetUserDiscriminator = ('0000'); - -export interface Error { - code: number; - message: string; -} - -export interface InnerErrors { - _errors: Array<Error>; -} - -export type ErrorDetails = ({ - [key: string]: ErrorDetails; -} | InnerErrors); - -export type ErrorResponse = (Error & { - errors?: ErrorDetails; -}); - -export type RatelimitedResponse = (Error & { - retry_after: number; - global: boolean; -}); - - -export interface DiscordApiEndpoints { - "/applications/@me": { - get: { - response: PrivateApplicationResponse; - }; - patch: { - requestBody: ApplicationFormPartial; - response: PrivateApplicationResponse; - }; - }; - "/applications/{application_id}": { - get: { - response: PrivateApplicationResponse; - }; - patch: { - requestBody: ApplicationFormPartial; - response: PrivateApplicationResponse; - }; - }; - "/applications/{application_id}/activity-instances/{instance_id}": { - get: { - response: EmbeddedActivityInstance; - }; - }; - "/applications/{application_id}/attachment": { - post: { - response: ActivitiesAttachmentResponse; - }; - }; - "/applications/{application_id}/commands": { - get: { - parameters: { - query: { - with_localizations?: boolean; - }; - }; - response: (Array<ApplicationCommandResponse> | null); - }; - put: { - requestBody: (Array<ApplicationCommandUpdateRequest> | null); - response: (Array<ApplicationCommandResponse> | null); - }; - post: { - requestBody: ApplicationCommandCreateRequest; - response: ApplicationCommandResponse; - }; - }; - "/applications/{application_id}/commands/{command_id}": { - get: { - response: ApplicationCommandResponse; - }; - delete: { - response: void; - }; - patch: { - requestBody: ApplicationCommandPatchRequestPartial; - response: ApplicationCommandResponse; - }; - }; - "/applications/{application_id}/emojis": { - get: { - response: ListApplicationEmojisResponse; - }; - post: { - requestBody: { - name: string; - image: string; -}; - response: EmojiResponse; - }; - }; - "/applications/{application_id}/emojis/{emoji_id}": { - get: { - response: EmojiResponse; - }; - delete: { - response: void; - }; - patch: { - requestBody: { - name?: string; -}; - response: EmojiResponse; - }; - }; - "/applications/{application_id}/entitlements": { - get: { - parameters: { - query: { - user_id?: Snowflake; - sku_ids?: (string | Array<(null | Snowflake)>); - guild_id?: Snowflake; - before?: Snowflake; - after?: Snowflake; - limit?: number; - exclude_ended?: boolean; - exclude_deleted?: boolean; - only_active?: boolean; - }; - }; - response: Array<EntitlementResponse>; - }; - post: { - requestBody: CreateEntitlementRequestData; - response: EntitlementResponse; - }; - }; - "/applications/{application_id}/entitlements/{entitlement_id}": { - get: { - response: EntitlementResponse; - }; - delete: { - response: void; - }; - }; - "/applications/{application_id}/entitlements/{entitlement_id}/consume": { - post: { - response: void; - }; - }; - "/applications/{application_id}/guilds/{guild_id}/commands": { - get: { - parameters: { - query: { - with_localizations?: boolean; - }; - }; - response: (Array<ApplicationCommandResponse> | null); - }; - put: { - requestBody: (Array<ApplicationCommandUpdateRequest> | null); - response: (Array<ApplicationCommandResponse> | null); - }; - post: { - requestBody: ApplicationCommandCreateRequest; - response: ApplicationCommandResponse; - }; - }; - "/applications/{application_id}/guilds/{guild_id}/commands/permissions": { - get: { - response: Array<CommandPermissionsResponse>; - }; - }; - "/applications/{application_id}/guilds/{guild_id}/commands/{command_id}": { - get: { - response: ApplicationCommandResponse; - }; - delete: { - response: void; - }; - patch: { - requestBody: ApplicationCommandPatchRequestPartial; - response: ApplicationCommandResponse; - }; - }; - "/applications/{application_id}/guilds/{guild_id}/commands/{command_id}/permissions": { - get: { - response: CommandPermissionsResponse; - }; - put: { - requestBody: { - permissions?: (Array<ApplicationCommandPermission> | null); -}; - response: CommandPermissionsResponse; - }; - }; - "/applications/{application_id}/role-connections/metadata": { - get: { - response: (Array<ApplicationRoleConnectionsMetadataItemResponse> | null); - }; - put: { - requestBody: (Array<ApplicationRoleConnectionsMetadataItemRequest> | null); - response: (Array<ApplicationRoleConnectionsMetadataItemResponse> | null); - }; - }; - "/channels/{channel_id}": { - get: { - response: (GuildChannelResponse | PrivateChannelResponse | PrivateGroupChannelResponse | ThreadResponse); - }; - delete: { - response: (GuildChannelResponse | PrivateChannelResponse | PrivateGroupChannelResponse | ThreadResponse); - }; - patch: { - requestBody: (UpdateDMRequestPartial | UpdateGroupDMRequestPartial | UpdateGuildChannelRequestPartial | UpdateThreadRequestPartial); - response: (GuildChannelResponse | PrivateChannelResponse | PrivateGroupChannelResponse | ThreadResponse); - }; - }; - "/channels/{channel_id}/followers": { - post: { - requestBody: { - webhook_channel_id: Snowflake; -}; - response: ChannelFollowerResponse; - }; - }; - "/channels/{channel_id}/invites": { - get: { - response: (Array<(FriendInviteResponse | GroupDMInviteResponse | GuildInviteResponse | null)> | null); - }; - post: { - requestBody: (CreateGroupDMInviteRequest | CreateGuildInviteRequest); - response: (FriendInviteResponse | GroupDMInviteResponse | GuildInviteResponse); - }; - }; - "/channels/{channel_id}/messages": { - get: { - parameters: { - query: { - around?: Snowflake; - before?: Snowflake; - after?: Snowflake; - limit?: number; - }; - }; - response: (Array<MessageResponse> | null); - }; - post: { - requestBody: MessageCreateRequest; - response: MessageResponse; - }; - }; - "/channels/{channel_id}/messages/bulk-delete": { - post: { - requestBody: { - messages: Array<Snowflake>; -}; - response: void; - }; - }; - "/channels/{channel_id}/messages/pins": { - get: { - parameters: { - query: { - before?: string; - limit?: number; - }; - }; - response: PinnedMessagesResponse; - }; - }; - "/channels/{channel_id}/messages/pins/{message_id}": { - put: { - response: void; - }; - delete: { - response: void; - }; - }; - "/channels/{channel_id}/messages/{message_id}": { - get: { - response: MessageResponse; - }; - delete: { - response: void; - }; - patch: { - requestBody: MessageEditRequestPartial; - response: MessageResponse; - }; - }; - "/channels/{channel_id}/messages/{message_id}/crosspost": { - post: { - response: MessageResponse; - }; - }; - "/channels/{channel_id}/messages/{message_id}/reactions": { - delete: { - response: void; - }; - }; - "/channels/{channel_id}/messages/{message_id}/reactions/{emoji_name}": { - get: { - parameters: { - query: { - after?: Snowflake; - limit?: number; - type?: ReactionTypes; - }; - }; - response: Array<UserResponse>; - }; - delete: { - response: void; - }; - }; - "/channels/{channel_id}/messages/{message_id}/reactions/{emoji_name}/@me": { - put: { - response: void; - }; - delete: { - response: void; - }; - }; - "/channels/{channel_id}/messages/{message_id}/reactions/{emoji_name}/{user_id}": { - delete: { - response: void; - }; - }; - "/channels/{channel_id}/messages/{message_id}/threads": { - post: { - requestBody: CreateTextThreadWithMessageRequest; - response: ThreadResponse; - }; - }; - "/channels/{channel_id}/permissions/{overwrite_id}": { - put: { - requestBody: { - type?: (null | ChannelPermissionOverwrites); - allow?: (number | null); - deny?: (number | null); -}; - response: void; - }; - delete: { - response: void; - }; - }; - "/channels/{channel_id}/pins": { - get: { - response: (Array<MessageResponse> | null); - }; - }; - "/channels/{channel_id}/pins/{message_id}": { - put: { - response: void; - }; - delete: { - response: void; - }; - }; - "/channels/{channel_id}/polls/{message_id}/answers/{answer_id}": { - get: { - parameters: { - query: { - after?: Snowflake; - limit?: number; - }; - }; - response: PollAnswerDetailsResponse; - }; - }; - "/channels/{channel_id}/polls/{message_id}/expire": { - post: { - response: MessageResponse; - }; - }; - "/channels/{channel_id}/recipients/{user_id}": { - put: { - requestBody: { - access_token?: (string | null); - nick?: (string | null); -}; - response: (PrivateChannelResponse | PrivateGroupChannelResponse); - }; - delete: { - response: void; - }; - }; - "/channels/{channel_id}/send-soundboard-sound": { - post: { - requestBody: SoundboardSoundSendRequest; - response: void; - }; - }; - "/channels/{channel_id}/thread-members": { - get: { - parameters: { - query: { - with_member?: boolean; - limit?: number; - after?: Snowflake; - }; - }; - response: Array<ThreadMemberResponse>; - }; - }; - "/channels/{channel_id}/thread-members/@me": { - put: { - response: void; - }; - delete: { - response: void; - }; - }; - "/channels/{channel_id}/thread-members/{user_id}": { - get: { - parameters: { - query: { - with_member?: boolean; - }; - }; - response: ThreadMemberResponse; - }; - put: { - response: void; - }; - delete: { - response: void; - }; - }; - "/channels/{channel_id}/threads": { - post: { - requestBody: (CreateForumThreadRequest | CreateTextThreadWithoutMessageRequest); - response: CreatedThreadResponse; - }; - }; - "/channels/{channel_id}/threads/archived/private": { - get: { - parameters: { - query: { - before?: string; - limit?: number; - }; - }; - response: ThreadsResponse; - }; - }; - "/channels/{channel_id}/threads/archived/public": { - get: { - parameters: { - query: { - before?: string; - limit?: number; - }; - }; - response: ThreadsResponse; - }; - }; - "/channels/{channel_id}/threads/search": { - get: { - parameters: { - query: { - name?: string; - slop?: number; - min_id?: Snowflake; - max_id?: Snowflake; - tag?: (string | Array<Snowflake>); - tag_setting?: ThreadSearchTagSetting; - archived?: boolean; - sort_by?: ThreadSortingMode; - sort_order?: SortingOrder; - limit?: number; - offset?: number; - }; - }; - response: ThreadSearchResponse; - }; - }; - "/channels/{channel_id}/typing": { - post: { - response: TypingIndicatorResponse; - }; - }; - "/channels/{channel_id}/users/@me/threads/archived/private": { - get: { - parameters: { - query: { - before?: Snowflake; - limit?: number; - }; - }; - response: ThreadsResponse; - }; - }; - "/channels/{channel_id}/voice-status": { - put: { - requestBody: { - status?: (string | null); -}; - response: void; - }; - }; - "/channels/{channel_id}/webhooks": { - get: { - response: (Array<(ApplicationIncomingWebhookResponse | ChannelFollowerWebhookResponse | GuildIncomingWebhookResponse)> | null); - }; - post: { - requestBody: { - name: string; - avatar?: (string | null); -}; - response: GuildIncomingWebhookResponse; - }; - }; - "/gateway": { - get: { - response: GatewayResponse; - }; - }; - "/gateway/bot": { - get: { - response: GatewayBotResponse; - }; - }; - "/guilds/templates/{code}": { - get: { - response: GuildTemplateResponse; - }; - }; - "/guilds/{guild_id}": { - get: { - parameters: { - query: { - with_counts?: boolean; - }; - }; - response: GuildWithCountsResponse; - }; - patch: { - requestBody: GuildPatchRequestPartial; - response: GuildResponse; - }; - }; - "/guilds/{guild_id}/audit-logs": { - get: { - parameters: { - query: { - user_id?: Snowflake; - target_id?: Snowflake; - action_type?: AuditLogActionTypes; - before?: Snowflake; - after?: Snowflake; - limit?: number; - }; - }; - response: GuildAuditLogResponse; - }; - }; - "/guilds/{guild_id}/auto-moderation/rules": { - get: { - response: (Array<(DefaultKeywordRuleResponse | KeywordRuleResponse | MLSpamRuleResponse | MentionSpamRuleResponse | UserProfileRuleResponse | null)> | null); - }; - post: { - requestBody: (DefaultKeywordListUpsertRequest | KeywordUpsertRequest | MLSpamUpsertRequest | MentionSpamUpsertRequest | UserProfileUpsertRequest); - response: (DefaultKeywordRuleResponse | KeywordRuleResponse | MLSpamRuleResponse | MentionSpamRuleResponse | UserProfileRuleResponse); - }; - }; - "/guilds/{guild_id}/auto-moderation/rules/{rule_id}": { - get: { - response: (DefaultKeywordRuleResponse | KeywordRuleResponse | MLSpamRuleResponse | MentionSpamRuleResponse | UserProfileRuleResponse); - }; - delete: { - response: void; - }; - patch: { - requestBody: (DefaultKeywordListUpsertRequestPartial | KeywordUpsertRequestPartial | MLSpamUpsertRequestPartial | MentionSpamUpsertRequestPartial | UserProfileUpsertRequestPartial); - response: (DefaultKeywordRuleResponse | KeywordRuleResponse | MLSpamRuleResponse | MentionSpamRuleResponse | UserProfileRuleResponse); - }; - }; - "/guilds/{guild_id}/bans": { - get: { - parameters: { - query: { - limit?: number; - before?: Snowflake; - after?: Snowflake; - }; - }; - response: (Array<GuildBanResponse> | null); - }; - }; - "/guilds/{guild_id}/bans/{user_id}": { - get: { - response: GuildBanResponse; - }; - put: { - requestBody: BanUserFromGuildRequest; - response: void; - }; - delete: { - requestBody: UnbanUserFromGuildRequest; - response: void; - }; - }; - "/guilds/{guild_id}/bulk-ban": { - post: { - requestBody: BulkBanUsersRequest; - response: BulkBanUsersResponse; - }; - }; - "/guilds/{guild_id}/channels": { - get: { - response: (Array<(GuildChannelResponse | PrivateChannelResponse | PrivateGroupChannelResponse | ThreadResponse)> | null); - }; - post: { - requestBody: CreateGuildChannelRequest; - response: GuildChannelResponse; - }; - patch: { - requestBody: Array<{ - id?: (null | Snowflake); - position?: (number | null); - parent_id?: (null | Snowflake); - lock_permissions?: (boolean | null); -}>; - response: void; - }; - }; - "/guilds/{guild_id}/emojis": { - get: { - response: (Array<EmojiResponse> | null); - }; - post: { - requestBody: { - name: string; - image: string; - roles?: (Array<(null | Snowflake)> | null); -}; - response: EmojiResponse; - }; - }; - "/guilds/{guild_id}/emojis/{emoji_id}": { - get: { - response: EmojiResponse; - }; - delete: { - response: void; - }; - patch: { - requestBody: { - name?: string; - roles?: (Array<(null | Snowflake)> | null); -}; - response: EmojiResponse; - }; - }; - "/guilds/{guild_id}/incident-actions": { - put: { - requestBody: GuildIncidentActionsRequest; - response: GuildIncidentsDataResponse; - }; - }; - "/guilds/{guild_id}/integrations": { - get: { - response: (Array<(DiscordIntegrationResponse | ExternalConnectionIntegrationResponse | GuildSubscriptionIntegrationResponse)> | null); - }; - }; - "/guilds/{guild_id}/integrations/{integration_id}": { - delete: { - response: void; - }; - }; - "/guilds/{guild_id}/invites": { - get: { - response: (Array<(FriendInviteResponse | GroupDMInviteResponse | GuildInviteResponse | null)> | null); - }; - }; - "/guilds/{guild_id}/members": { - get: { - parameters: { - query: { - limit?: number; - after?: number; - }; - }; - response: Array<GuildMemberResponse>; - }; - }; - "/guilds/{guild_id}/members/@me": { - patch: { - requestBody: { - nick?: (string | null); - avatar?: (string | null); - bio?: (string | null); - banner?: (string | null); -}; - response: PrivateGuildMemberResponse; - }; - }; - "/guilds/{guild_id}/members/search": { - get: { - parameters: { - query: { - limit?: number; - query: string; - }; - }; - response: Array<GuildMemberResponse>; - }; - }; - "/guilds/{guild_id}/members/{user_id}": { - get: { - response: GuildMemberResponse; - }; - put: { - requestBody: BotAddGuildMemberRequest; - response: GuildMemberResponse; - }; - delete: { - response: void; - }; - patch: { - requestBody: { - nick?: (string | null); - roles?: (Array<(null | Snowflake)> | null); - mute?: (boolean | null); - deaf?: (boolean | null); - channel_id?: (null | Snowflake); - communication_disabled_until?: (string | null); - flags?: (number | null); -}; - response: GuildMemberResponse; - }; - }; - "/guilds/{guild_id}/members/{user_id}/roles/{role_id}": { - put: { - response: void; - }; - delete: { - response: void; - }; - }; - "/guilds/{guild_id}/messages/search": { - get: { - parameters: { - query: { - sort_by?: SortingMode; - sort_order?: SortingOrder; - content?: string; - slop?: number; - author_id?: Array<Snowflake>; - author_type?: Array<AuthorType>; - mentions?: Array<Snowflake>; - mentions_role_id?: Array<Snowflake>; - replied_to_user_id?: Array<Snowflake>; - replied_to_message_id?: Array<Snowflake>; - mention_everyone?: boolean; - min_id?: Snowflake; - max_id?: Snowflake; - limit?: number; - offset?: number; - has?: Array<HasOption>; - link_hostname?: Array<string>; - embed_provider?: Array<string>; - embed_type?: Array<SearchableEmbedType>; - attachment_extension?: Array<string>; - attachment_filename?: Array<string>; - pinned?: boolean; - include_nsfw?: boolean; - channel_id?: Array<Snowflake>; - }; - }; - response: GuildSearchResponse; - }; - }; - "/guilds/{guild_id}/new-member-welcome": { - get: { - response: GuildHomeSettingsResponse; - }; - }; - "/guilds/{guild_id}/onboarding": { - get: { - response: UserGuildOnboardingResponse; - }; - put: { - requestBody: UpdateGuildOnboardingRequest; - response: GuildOnboardingResponse; - }; - }; - "/guilds/{guild_id}/preview": { - get: { - response: GuildPreviewResponse; - }; - }; - "/guilds/{guild_id}/prune": { - get: { - parameters: { - query: { - days?: number; - include_roles?: (string | Array<(null | Snowflake)>); - }; - }; - response: GuildPruneResponse; - }; - post: { - requestBody: PruneGuildRequest; - response: GuildPruneResponse; - }; - }; - "/guilds/{guild_id}/regions": { - get: { - response: (Array<VoiceRegionResponse> | null); - }; - }; - "/guilds/{guild_id}/requests": { - get: { - parameters: { - query: { - status?: (GuildJoinRequestApplicationStatus); - limit?: number; - before?: Snowflake; - after?: Snowflake; - }; - }; - response: GuildJoinRequestsListResponse; - }; - }; - "/guilds/{guild_id}/requests/{request_id}": { - patch: { - requestBody: { - action?: (GuildJoinRequestApplicationStatus); - rejection_reason?: (string | null); -}; - response: GuildJoinRequestResponse; - }; - }; - "/guilds/{guild_id}/roles": { - get: { - response: Array<GuildRoleResponse>; - }; - post: { - requestBody: CreateRoleRequest; - response: GuildRoleResponse; - }; - patch: { - requestBody: Array<UpdateRolePositionsRequest>; - response: Array<GuildRoleResponse>; - }; - }; - "/guilds/{guild_id}/roles/member-counts": { - get: { - response: { - [key: string]: number; -}; - }; - }; - "/guilds/{guild_id}/roles/{role_id}": { - get: { - response: GuildRoleResponse; - }; - delete: { - response: void; - }; - patch: { - requestBody: UpdateRoleRequestPartial; - response: GuildRoleResponse; - }; - }; - "/guilds/{guild_id}/scheduled-events": { - get: { - parameters: { - query: { - with_user_count?: boolean; - }; - }; - response: (Array<(ExternalScheduledEventResponse | StageScheduledEventResponse | VoiceScheduledEventResponse)> | null); - }; - post: { - requestBody: (ExternalScheduledEventCreateRequest | StageScheduledEventCreateRequest | VoiceScheduledEventCreateRequest); - response: (ExternalScheduledEventResponse | StageScheduledEventResponse | VoiceScheduledEventResponse); - }; - }; - "/guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}": { - get: { - parameters: { - query: { - with_user_count?: boolean; - }; - }; - response: (ExternalScheduledEventResponse | StageScheduledEventResponse | VoiceScheduledEventResponse); - }; - delete: { - response: void; - }; - patch: { - requestBody: (ExternalScheduledEventPatchRequestPartial | StageScheduledEventPatchRequestPartial | VoiceScheduledEventPatchRequestPartial); - response: (ExternalScheduledEventResponse | StageScheduledEventResponse | VoiceScheduledEventResponse); - }; - }; - "/guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}/exceptions": { - post: { - requestBody: GuildScheduledEventExceptionCreateRequest; - response: GuildScheduledEventExceptionResponse; - }; - }; - "/guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}/exceptions/{exception_id}": { - delete: { - response: void; - }; - patch: { - requestBody: GuildScheduledEventExceptionPatchRequestPartial; - response: GuildScheduledEventExceptionResponse; - }; - }; - "/guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}/users": { - get: { - parameters: { - query: { - with_member?: boolean; - limit?: number; - before?: Snowflake; - after?: Snowflake; - }; - }; - response: (Array<ScheduledEventUserResponse> | null); - }; - }; - "/guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}/users/counts": { - get: { - parameters: { - query: { - guild_scheduled_event_exception_ids?: Array<Snowflake>; - }; - }; - response: ScheduledEventUserCountResponse; - }; - }; - "/guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}/{guild_scheduled_event_exception_id}/users": { - get: { - parameters: { - query: { - with_member?: boolean; - limit?: number; - before?: Snowflake; - after?: Snowflake; - }; - }; - response: (Array<ScheduledEventUserResponse> | null); - }; - }; - "/guilds/{guild_id}/soundboard-sounds": { - get: { - response: ListGuildSoundboardSoundsResponse; - }; - post: { - requestBody: SoundboardCreateRequest; - response: SoundboardSoundResponse; - }; - }; - "/guilds/{guild_id}/soundboard-sounds/{sound_id}": { - get: { - response: SoundboardSoundResponse; - }; - delete: { - response: void; - }; - patch: { - requestBody: SoundboardPatchRequestPartial; - response: SoundboardSoundResponse; - }; - }; - "/guilds/{guild_id}/stickers": { - get: { - response: Array<GuildStickerResponse>; - }; - post: { - response: GuildStickerResponse; - }; - }; - "/guilds/{guild_id}/stickers/{sticker_id}": { - get: { - response: GuildStickerResponse; - }; - delete: { - response: void; - }; - patch: { - requestBody: { - name?: string; - tags?: string; - description?: (string | null); -}; - response: GuildStickerResponse; - }; - }; - "/guilds/{guild_id}/templates": { - get: { - response: (Array<GuildTemplateResponse> | null); - }; - post: { - requestBody: { - name: string; - description?: (string | null); -}; - response: GuildTemplateResponse; - }; - }; - "/guilds/{guild_id}/templates/{code}": { - put: { - response: GuildTemplateResponse; - }; - delete: { - response: GuildTemplateResponse; - }; - patch: { - requestBody: { - name?: string; - description?: (string | null); -}; - response: GuildTemplateResponse; - }; - }; - "/guilds/{guild_id}/threads/active": { - get: { - response: ThreadsResponse; - }; - }; - "/guilds/{guild_id}/vanity-url": { - get: { - response: VanityURLResponse; - }; - }; - "/guilds/{guild_id}/voice-states/@me": { - get: { - response: VoiceStateResponse; - }; - patch: { - requestBody: UpdateSelfVoiceStateRequestPartial; - response: void; - }; - }; - "/guilds/{guild_id}/voice-states/{user_id}": { - get: { - response: VoiceStateResponse; - }; - patch: { - requestBody: UpdateVoiceStateRequestPartial; - response: void; - }; - }; - "/guilds/{guild_id}/webhooks": { - get: { - response: (Array<(ApplicationIncomingWebhookResponse | ChannelFollowerWebhookResponse | GuildIncomingWebhookResponse)> | null); - }; - }; - "/guilds/{guild_id}/welcome-screen": { - get: { - response: GuildWelcomeScreenResponse; - }; - patch: { - requestBody: WelcomeScreenPatchRequestPartial; - response: GuildWelcomeScreenResponse; - }; - }; - "/guilds/{guild_id}/widget": { - get: { - response: WidgetSettingsResponse; - }; - patch: { - requestBody: { - channel_id?: (null | Snowflake); - enabled?: (boolean | null); -}; - response: WidgetSettingsResponse; - }; - }; - "/guilds/{guild_id}/widget.json": { - get: { - response: WidgetResponse; - }; - }; - "/guilds/{guild_id}/widget.png": { - get: { - parameters: { - query: { - style?: WidgetImageStyles; - }; - }; - response: void; - }; - }; - "/interactions/{interaction_id}/{interaction_token}/callback": { - post: { - parameters: { - query: { - with_response?: boolean; - }; - }; - requestBody: (ApplicationCommandAutocompleteCallbackRequest | CreateMessageInteractionCallbackRequest | LaunchActivityInteractionCallbackRequest | ModalInteractionCallbackRequest | PongInteractionCallbackRequest | SocialLayerSKUPurchaseEligibilityInteractionCallbackRequest | UpdateMessageInteractionCallbackRequest); - response: InteractionCallbackResponse; - }; - }; - "/invites/{code}": { - get: { - parameters: { - query: { - with_counts?: boolean; - guild_scheduled_event_id?: Snowflake; - }; - }; - response: (FriendInviteResponse | GroupDMInviteResponse | GuildInviteResponse); - }; - delete: { - response: (FriendInviteResponse | GroupDMInviteResponse | GuildInviteResponse); - }; - }; - "/invites/{code}/target-users": { - get: { - response: void; - }; - put: { - response: void; - }; - }; - "/invites/{code}/target-users/job-status": { - get: { - response: TargetUsersJobStatusResponse; - }; - }; - "/lobbies": { - put: { - requestBody: { - idle_timeout_seconds?: (number | null); - lobby_metadata?: ({ - [key: string]: string; -} | null); - member_metadata?: ({ - [key: string]: string; -} | null); - secret: string; - flags?: (null | 1); -}; - response: LobbyResponse; - }; - post: { - requestBody: { - idle_timeout_seconds?: (number | null); - members?: (Array<LobbyMemberRequest> | null); - metadata?: ({ - [key: string]: string; -} | null); - flags?: (null | 1); - override_event_webhooks_url?: (string | null); -}; - response: LobbyResponse; - }; - }; - "/lobbies/{lobby_id}": { - get: { - response: LobbyResponse; - }; - delete: { - response: void; - }; - patch: { - requestBody: { - idle_timeout_seconds?: (number | null); - metadata?: ({ - [key: string]: string; -} | null); - members?: (Array<LobbyMemberRequest> | null); - flags?: (null | 1); - override_event_webhooks_url?: (string | null); -}; - response: LobbyResponse; - }; - }; - "/lobbies/{lobby_id}/channel-linking": { - patch: { - requestBody: { - channel_id?: (null | Snowflake); -}; - response: LobbyResponse; - }; - }; - "/lobbies/{lobby_id}/members/@me": { - delete: { - response: void; - }; - }; - "/lobbies/{lobby_id}/members/@me/invites": { - post: { - response: LobbyGuildInviteResponse; - }; - }; - "/lobbies/{lobby_id}/members/bulk": { - post: { - requestBody: (Array<BulkLobbyMemberRequest> | null); - response: (Array<LobbyMemberResponse> | null); - }; - }; - "/lobbies/{lobby_id}/members/{user_id}": { - put: { - requestBody: { - metadata?: ({ - [key: string]: string; -} | null); - flags?: (null | 1); -}; - response: LobbyMemberResponse; - }; - delete: { - response: void; - }; - }; - "/lobbies/{lobby_id}/members/{user_id}/invites": { - post: { - response: LobbyGuildInviteResponse; - }; - }; - "/lobbies/{lobby_id}/messages": { - get: { - parameters: { - query: { - limit?: number; - }; - }; - response: (Array<LobbyMessageResponse> | null); - }; - post: { - requestBody: SDKMessageRequest; - response: LobbyMessageResponse; - }; - }; - "/lobbies/{lobby_id}/messages/{message_id}/moderation-metadata": { - put: { - requestBody: { - [key: string]: string; -}; - response: void; - }; - }; - "/oauth2/@me": { - get: { - response: OAuth2GetAuthorizationResponse; - }; - }; - "/oauth2/applications/@me": { - get: { - response: PrivateApplicationResponse; - }; - }; - "/oauth2/keys": { - get: { - response: OAuth2GetKeys; - }; - }; - "/oauth2/userinfo": { - get: { - response: OAuth2GetOpenIDConnectUserInfoResponse; - }; - }; - "/partner-sdk/dms/{user_id_1}/{user_id_2}/messages/{message_id}/moderation-metadata": { - put: { - requestBody: { - [key: string]: string; -}; - response: void; - }; - }; - "/partner-sdk/provisional-accounts/unmerge": { - post: { - requestBody: { - client_id: Snowflake; - client_secret?: (string | null); - external_auth_token: string; - external_auth_type: ApplicationIdentityProviderAuthType; -}; - response: void; - }; - }; - "/partner-sdk/provisional-accounts/unmerge/bot": { - post: { - requestBody: { - external_user_id: string; -}; - response: void; - }; - }; - "/partner-sdk/token": { - post: { - requestBody: { - client_id: Snowflake; - client_secret?: (string | null); - external_auth_token: string; - external_auth_type: ApplicationIdentityProviderAuthType; -}; - response: ProvisionalTokenResponse; - }; - }; - "/partner-sdk/token/bot": { - post: { - requestBody: { - provisional_user_id?: (null | Snowflake); - external_user_id: string; - preferred_global_name?: (string | null); -}; - response: ProvisionalTokenResponse; - }; - }; - "/skus/{sku_id}/subscriptions": { - get: { - parameters: { - query: { - before?: Snowflake; - after?: Snowflake; - limit?: number; - user_id?: Snowflake; - }; - }; - response: Array<SubscriptionResponse>; - }; - }; - "/skus/{sku_id}/subscriptions/{subscription_id}": { - get: { - parameters: { - query: { - user_id?: Snowflake; - }; - }; - response: SubscriptionResponse; - }; - }; - "/soundboard-default-sounds": { - get: { - response: Array<SoundboardSoundResponse>; - }; - }; - "/stage-instances": { - post: { - requestBody: { - topic: string; - channel_id: Snowflake; - privacy_level?: (null | StageInstancesPrivacyLevels); - guild_scheduled_event_id?: (null | Snowflake); - send_start_notification?: (boolean | null); -}; - response: StageInstanceResponse; - }; - }; - "/stage-instances/{channel_id}": { - get: { - response: StageInstanceResponse; - }; - delete: { - response: void; - }; - patch: { - requestBody: { - topic?: string; - privacy_level?: StageInstancesPrivacyLevels; -}; - response: StageInstanceResponse; - }; - }; - "/sticker-packs": { - get: { - response: StickerPackCollectionResponse; - }; - }; - "/sticker-packs/{pack_id}": { - get: { - response: StickerPackResponse; - }; - }; - "/stickers/{sticker_id}": { - get: { - response: (GuildStickerResponse | StandardStickerResponse); - }; - }; - "/users/@me": { - get: { - response: UserPIIResponse; - }; - patch: { - requestBody: BotAccountPatchRequest; - response: UserPIIResponse; - }; - }; - "/users/@me/applications/{application_id}/entitlements": { - get: { - parameters: { - query: { - sku_ids?: (string | Array<(null | Snowflake)>); - exclude_consumed?: boolean; - }; - }; - response: Array<EntitlementResponse>; - }; - }; - "/users/@me/applications/{application_id}/role-connection": { - get: { - response: ApplicationUserRoleConnectionResponse; - }; - put: { - requestBody: UpdateApplicationUserRoleConnectionRequest; - response: ApplicationUserRoleConnectionResponse; - }; - delete: { - response: void; - }; - }; - "/users/@me/channels": { - post: { - requestBody: CreatePrivateChannelRequest; - response: (PrivateChannelResponse | PrivateGroupChannelResponse); - }; - }; - "/users/@me/connections": { - get: { - response: (Array<ConnectedAccountResponse> | null); - }; - }; - "/users/@me/guilds": { - get: { - parameters: { - query: { - before?: Snowflake; - after?: Snowflake; - limit?: number; - with_counts?: boolean; - }; - }; - response: (Array<MyGuildResponse> | null); - }; - }; - "/users/@me/guilds/{guild_id}": { - delete: { - response: void; - }; - }; - "/users/@me/guilds/{guild_id}/member": { - get: { - response: PrivateGuildMemberResponse; - }; - }; - "/users/{user_id}": { - get: { - response: UserResponse; - }; - }; - "/voice/regions": { - get: { - response: (Array<VoiceRegionResponse> | null); - }; - }; - "/webhooks/{webhook_id}": { - get: { - response: (ApplicationIncomingWebhookResponse | ChannelFollowerWebhookResponse | GuildIncomingWebhookResponse); - }; - delete: { - response: void; - }; - patch: { - requestBody: { - name?: string; - avatar?: (string | null); - channel_id?: (null | Snowflake); -}; - response: (ApplicationIncomingWebhookResponse | ChannelFollowerWebhookResponse | GuildIncomingWebhookResponse); - }; - }; - "/webhooks/{webhook_id}/{webhook_token}": { - get: { - response: (ApplicationIncomingWebhookResponse | ChannelFollowerWebhookResponse | GuildIncomingWebhookResponse); - }; - post: { - parameters: { - query: { - wait?: boolean; - thread_id?: Snowflake; - with_components?: boolean; - }; - }; - requestBody: (IncomingWebhookRequestPartial | IncomingWebhookUpdateRequestPartial); - response: MessageResponse; - }; - delete: { - response: void; - }; - patch: { - requestBody: { - name?: string; - avatar?: (string | null); -}; - response: (ApplicationIncomingWebhookResponse | ChannelFollowerWebhookResponse | GuildIncomingWebhookResponse); - }; - }; - "/webhooks/{webhook_id}/{webhook_token}/github": { - post: { - parameters: { - query: { - wait?: boolean; - thread_id?: Snowflake; - }; - }; - requestBody: GithubWebhook; - response: void; - }; - }; - "/webhooks/{webhook_id}/{webhook_token}/messages/@original": { - get: { - parameters: { - query: { - thread_id?: Snowflake; - }; - }; - response: MessageResponse; - }; - delete: { - parameters: { - query: { - thread_id?: Snowflake; - }; - }; - response: void; - }; - patch: { - parameters: { - query: { - thread_id?: Snowflake; - with_components?: boolean; - }; - }; - requestBody: IncomingWebhookUpdateRequestPartial; - response: MessageResponse; - }; - }; - "/webhooks/{webhook_id}/{webhook_token}/messages/{message_id}": { - get: { - parameters: { - query: { - thread_id?: Snowflake; - }; - }; - response: MessageResponse; - }; - delete: { - parameters: { - query: { - thread_id?: Snowflake; - }; - }; - response: void; - }; - patch: { - parameters: { - query: { - thread_id?: Snowflake; - with_components?: boolean; - }; - }; - requestBody: IncomingWebhookUpdateRequestPartial; - response: MessageResponse; - }; - }; - "/webhooks/{webhook_id}/{webhook_token}/slack": { - post: { - parameters: { - query: { - wait?: boolean; - thread_id?: Snowflake; - }; - }; - requestBody: SlackWebhook; - response: (string | null); - }; - }; -}
D pkgs/types/src/index.ts

@@ -1,1 +0,0 @@

-console.log("Hello via Bun!");
M pkgs/types/src/lib/generator.tspkgs/types/src/lib/generator.ts

@@ -48,6 +48,58 @@

return output.join("\n"); } +export function generateModelsSpec(schemas: Record<string, JSONSchema>): string { + const output: string[] = []; + + output.push("// this file is auto-generated. don;t edit it manually."); + output.push("// TODO)) separate snowflakes for users, guilds, channels, etc"); + output.push("export type Snowflake = string;"); + output.push(""); + + for (const [name, schema] of Object.entries(schemas)) { + try { + output.push(generateType(name, schema)); + output.push(""); + } catch (err) { + output.push(`// failed to generate model: ${name}. Error: ${(err as Error).message}`); + output.push(""); + } + } + + return output.join("\n"); +} + +export function generateRoutesSpec(paths: Record<string, any>, modelNamespace = "Models"): string { + const output: string[] = []; + + output.push("// this file is auto-generated. don;t edit it manually."); + output.push(`import * as ${modelNamespace} from "./models";`); + output.push(""); + output.push("export interface DiscordApiEndpoints {"); + + for (const [pathKey, pathData] of Object.entries(paths)) { + output.push(` "${pathKey}": {`); + + for (const [method, operation] of Object.entries(pathData as Record<string, any>)) { + if ( + !["get", "post", "put", "delete", "patch", "options", "head"].includes(method.toLowerCase()) + ) { + continue; + } + + output.push(` ${method.toLowerCase()}: {`); + const opDetails = resolvePathOperation(operation, modelNamespace); + output.push(opDetails); + output.push(" };"); + } + + output.push(" };"); + } + + output.push("}"); + return output.join("\n"); +} + function generateType(name: string, schema: JSONSchema): string { const hasMultiType = Array.isArray(schema.type); const isObject = schema.type === "object" || (!schema.type && schema.properties);

@@ -85,34 +137,34 @@

return `export interface ${name} {\n${props.join("\n")}\n}`; } -function resolveSingleType(type: string, schema: JSONSchema): string { +function resolveSingleType(type: string, schema: JSONSchema, namespace = ""): string { switch (type) { case "integer": case "number": return "number"; case "string": - if (schema.format === "snowflake") return "Snowflake"; + if (schema.format === "snowflake") return namespace ? `${namespace}.Snowflake` : "Snowflake"; return "string"; case "boolean": return "boolean"; case "null": return "null"; case "array": { - const itemsType = schema.items ? resolvePropertyType(schema.items) : "any"; + const itemsType = schema.items ? resolvePropertyType(schema.items, namespace) : "any"; return `Array<${itemsType}>`; } case "object": { const requiredProps = schema.required || []; const nestedProps = Object.entries(schema.properties || {}).map(([propName, propSchema]) => { const isRequired = requiredProps.includes(propName); - const parsedType = resolvePropertyType(propSchema as JSONSchema); + const parsedType = resolvePropertyType(propSchema as JSONSchema, namespace); return ` ${propName}${isRequired ? "" : "?"}: ${parsedType};`; }); if (schema.additionalProperties) { const dictType = typeof schema.additionalProperties === "object" - ? resolvePropertyType(schema.additionalProperties) + ? resolvePropertyType(schema.additionalProperties, namespace) : "any"; nestedProps.push(` [key: string]: ${dictType};`); }

@@ -127,38 +179,41 @@ return "any";

} } -export function resolvePropertyType(schema: JSONSchema): string { +export function resolvePropertyType(schema: JSONSchema, namespace = ""): string { if (!schema) return "any"; if (schema.$ref) { const refName = schema.$ref.split("/").pop() || "unknown"; - if (refName.toLowerCase().includes("snowflake")) { - return "Snowflake"; - } - return refName; + if (refName.toLowerCase().includes("snowflake")) + return namespace ? `${namespace}.Snowflake` : "Snowflake"; + + return namespace ? `${namespace}.${refName}` : refName; } - if (schema.oneOf) return `(${schema.oneOf.map(resolvePropertyType).join(" | ")})`; - if (schema.anyOf) return `(${schema.anyOf.map(resolvePropertyType).join(" | ")})`; - if (schema.allOf) return `(${schema.allOf.map(resolvePropertyType).join(" & ")})`; + if (schema.oneOf) + return `(${schema.oneOf.map((s: JSONSchema) => resolvePropertyType(s, namespace)).join(" | ")})`; + if (schema.anyOf) + return `(${schema.anyOf.map((s: JSONSchema) => resolvePropertyType(s, namespace)).join(" | ")})`; + if (schema.allOf) + return `(${schema.allOf.map((s: JSONSchema) => resolvePropertyType(s, namespace)).join(" & ")})`; if (schema.enum) return schema.enum.map((val: any) => (typeof val === "string" ? `'${val}'` : val)).join(" | "); if (Array.isArray(schema.type)) { - const types = schema.type.map((t: string) => resolveSingleType(t, schema)); + const types = schema.type.map((t: string) => resolveSingleType(t, schema, namespace)); return `(${types.join(" | ")})`; } - if (schema.type) return resolveSingleType(schema.type, schema); - if (schema.properties) return resolveSingleType("object", schema); + if (schema.type) return resolveSingleType(schema.type, schema, namespace); + if (schema.properties) return resolveSingleType("object", schema, namespace); if (schema.const !== undefined) return typeof schema.const === "string" ? `'${schema.const}'` : `${schema.const}`; return "any"; } -function resolvePathOperation(operation: any): string { +function resolvePathOperation(operation: any, namespace = ""): string { const parts: string[] = []; const parameters = operation.parameters || []; const pathParams = parameters.filter((p: any) => p.in === "path");

@@ -170,7 +225,7 @@ if (pathParams.length > 0) {

parts.push(" path: {"); for (const param of pathParams) { - const type = resolvePropertyType(param.schema || {}); + const type = resolvePropertyType(param.schema || {}, namespace); parts.push(` ${param.name}: ${type};`); }

@@ -180,7 +235,7 @@ if (queryParams.length > 0) {

parts.push(" query: {"); for (const param of queryParams) { - const type = resolvePropertyType(param.schema || {}); + const type = resolvePropertyType(param.schema || {}, namespace); const req = param.required ? "" : "?"; parts.push(` ${param.name}${req}: ${type};`); }

@@ -193,10 +248,9 @@

const requestBody = operation.requestBody; if (requestBody) { const content = requestBody.content; - if (content && content["application/json"]) { const schema = content["application/json"].schema; - parts.push(` requestBody: ${resolvePropertyType(schema)};`); + parts.push(` requestBody: ${resolvePropertyType(schema, namespace)};`); } }

@@ -205,9 +259,10 @@ const successCode = Object.keys(responses).find((code) => code.startsWith("2"));

if (successCode) { const responseObj = responses[successCode]; const content = responseObj.content; + if (content && content["application/json"]) { const schema = content["application/json"].schema; - parts.push(` response: ${resolvePropertyType(schema)};`); + parts.push(` response: ${resolvePropertyType(schema, namespace)};`); } else { parts.push(" response: void;"); }
M pkgs/types/src/lib/index.tspkgs/types/src/lib/index.ts

@@ -1,7 +1,7 @@

import * as fs from "fs/promises"; import * as path from "path"; import { OpenAPISpec } from "./types"; -import { generateTypeScriptSpec } from "./generator"; +import { generateModelsSpec, generateRoutesSpec } from "./generator"; const SPEC_URL = "https://raw.githubusercontent.com/discord/discord-api-spec/main/specs/openapi.json";

@@ -16,16 +16,22 @@ }

const spec = (await res.json()) as OpenAPISpec; - console.log("generating typescript code..."); const schemas = spec.components?.schemas || {}; const paths = spec.paths || {}; - const generatedCode = generateTypeScriptSpec(schemas, paths); + console.log("generating models.ts..."); + const modelsCode = generateModelsSpec(schemas); + const modelsPath = path.join(process.cwd(), "models.ts"); + await fs.writeFile(modelsPath, modelsCode, "utf-8"); - const outputPath = path.join(process.cwd(), "discord-api-types.ts"); - await fs.writeFile(outputPath, generatedCode, "utf-8"); + console.log("generating routes.ts..."); + const routesCode = generateRoutesSpec(paths, "Models"); + const routesPath = path.join(process.cwd(), "routes.ts"); + await fs.writeFile(routesPath, routesCode, "utf-8"); - console.log(`generated types at: ${outputPath}`); + console.log("\ntype generation complete!"); + console.log(`- models generated at: ${modelsPath}`); + console.log(`- routes generated at: ${routesPath}`); } main().catch((err) => {