mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 08:03:30 +01:00
22 lines
502 B
TypeScript
22 lines
502 B
TypeScript
import { ComponentType } from 'discord-api-types/v10';
|
|
import { z } from 'zod';
|
|
import { customIdPredicate } from '../../Assertions.js';
|
|
|
|
const titlePredicate = z.string().min(1).max(45);
|
|
|
|
export const modalPredicate = z.object({
|
|
title: titlePredicate,
|
|
custom_id: customIdPredicate,
|
|
components: z
|
|
.object({
|
|
type: z.literal(ComponentType.ActionRow),
|
|
components: z
|
|
.object({ type: z.literal(ComponentType.TextInput) })
|
|
.array()
|
|
.length(1),
|
|
})
|
|
.array()
|
|
.min(1)
|
|
.max(5),
|
|
});
|