feat!: use zod v4 (#10922)

* feat: zod 4

* feat: zod v3, but v4

feat: validation error class

Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com>

* chore: bump

---------

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com>
This commit is contained in:
Almeida
2025-07-03 01:02:45 +01:00
committed by GitHub
parent 4dbeed933b
commit a5bd4cfe73
20 changed files with 183 additions and 199 deletions

View File

@@ -579,7 +579,7 @@ class ApplicationCommand extends Base {
* {@link ApplicationCommandOptionType.Number} option
* @property {ApplicationCommandOptionChoice[]} [choices] The choices of the option for the user to pick from
* @property {ApplicationCommandOption[]} [options] Additional options if this option is a subcommand (group)
* @property {ApplicationCommandOptionAllowedChannelTypes[]} [channelTypes] When the option type is channel,
* @property {ApplicationCommandOptionAllowedChannelType[]} [channelTypes] When the option type is channel,
* the allowed types of channels that can be selected
* @property {number} [minValue] The minimum value for an {@link ApplicationCommandOptionType.Integer} or
* {@link ApplicationCommandOptionType.Number} option
@@ -653,6 +653,6 @@ class ApplicationCommand extends Base {
exports.ApplicationCommand = ApplicationCommand;
/**
* @external ApplicationCommandOptionAllowedChannelTypes
* @see {@link https://discord.js.org/docs/packages/builders/stable/ApplicationCommandOptionAllowedChannelTypes:TypeAlias}
* @external ApplicationCommandOptionAllowedChannelType
* @see {@link https://discord.js.org/docs/packages/builders/stable/ApplicationCommandOptionAllowedChannelType:TypeAlias}
*/

View File

@@ -2,7 +2,7 @@ import { Buffer } from 'node:buffer';
import { ChildProcess } from 'node:child_process';
import { Stream } from 'node:stream';
import { MessagePort, Worker } from 'node:worker_threads';
import { ApplicationCommandOptionAllowedChannelTypes, MessageActionRowComponentBuilder } from '@discordjs/builders';
import { ApplicationCommandOptionAllowedChannelType, MessageActionRowComponentBuilder } from '@discordjs/builders';
import { Collection, ReadonlyCollection } from '@discordjs/collection';
import { BaseImageURLOptions, ImageURLOptions, RawFile, REST, RESTOptions, EmojiURLOptions } from '@discordjs/rest';
import { Awaitable, JSONEncodable } from '@discordjs/util';
@@ -4823,13 +4823,13 @@ export type ApplicationCommandData =
| UserApplicationCommandData;
export interface ApplicationCommandChannelOptionData extends BaseApplicationCommandOptionsData {
channelTypes?: readonly ApplicationCommandOptionAllowedChannelTypes[];
channel_types?: readonly ApplicationCommandOptionAllowedChannelTypes[];
channelTypes?: readonly ApplicationCommandOptionAllowedChannelType[];
channel_types?: readonly ApplicationCommandOptionAllowedChannelType[];
type: CommandOptionChannelResolvableType;
}
export interface ApplicationCommandChannelOption extends BaseApplicationCommandOptionsData {
channelTypes?: readonly ApplicationCommandOptionAllowedChannelTypes[];
channelTypes?: readonly ApplicationCommandOptionAllowedChannelType[];
type: ApplicationCommandOptionType.Channel;
}