mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-02 17:10:08 +00:00
BREAKING CHANGE: formatters export removed (prev. deprecated) BREAKING CHANGE: `SelectMenuBuilder` and `SelectMenuOptionBuilder` have been removed (prev. deprecated) BREAKING CHANGE: `EmbedBuilder` no longer takes camalCase options BREAKING CHANGE: `ActionRowBuilder` now has specialized `[add/set]X` methods as opposed to the current `[add/set]Components` BREAKING CHANGE: Removed `equals` methods BREAKING CHANGE: Sapphire -> zod for validation BREAKING CHANGE: Removed the ability to pass `null`/`undefined` to clear fields, use `clearX()` instead BREAKING CHANGE: Renamed all "slash command" symbols to instead use "chat input command" BREAKING CHANGE: Removed `ContextMenuCommandBuilder` in favor of `MessageCommandBuilder` and `UserCommandBuilder` BREAKING CHANGE: Removed support for passing the "string key"s of enums BREAKING CHANGE: Removed `Button` class in favor for specialized classes depending on the style BREAKING CHANGE: Removed nested `addX` styled-methods in favor of plural `addXs` Co-authored-by: Vlad Frangu <me@vladfrangu.dev> Co-authored-by: Almeida <github@almeidx.dev>
16 lines
581 B
TypeScript
16 lines
581 B
TypeScript
import { ComponentType, TextInputStyle } from 'discord-api-types/v10';
|
|
import { z } from 'zod';
|
|
import { customIdPredicate } from '../../Assertions.js';
|
|
|
|
export const textInputPredicate = z.object({
|
|
type: z.literal(ComponentType.TextInput),
|
|
custom_id: customIdPredicate,
|
|
label: z.string().min(1).max(45),
|
|
style: z.nativeEnum(TextInputStyle),
|
|
min_length: z.number().min(0).max(4_000).optional(),
|
|
max_length: z.number().min(1).max(4_000).optional(),
|
|
placeholder: z.string().max(100).optional(),
|
|
value: z.string().max(4_000).optional(),
|
|
required: z.boolean().optional(),
|
|
});
|