fix: Add idPredicate (#11109)

* fix: `idPredicate`

* fix: add test

* test: add negative test
This commit is contained in:
Jiralite
2025-09-26 17:06:22 +01:00
committed by GitHub
parent b3705df547
commit 0d76f1149f
7 changed files with 29 additions and 2 deletions

View File

@@ -1,8 +1,9 @@
import { ComponentType, TextInputStyle } from 'discord-api-types/v10';
import { z } from 'zod';
import { customIdPredicate } from '../../Assertions.js';
import { customIdPredicate, idPredicate } from '../../Assertions.js';
export const textInputPredicate = z.object({
id: idPredicate,
type: z.literal(ComponentType.TextInput),
custom_id: customIdPredicate,
style: z.enum(TextInputStyle),