mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
types: Allow builders to set channel types in discord.js (#8990)
types: allow builders to set channel types Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -518,7 +518,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 {ChannelType[]} [channelTypes] When the option type is channel,
|
||||
* @property {ApplicationCommandOptionAllowedChannelTypes[]} [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
|
||||
@@ -599,3 +599,8 @@ module.exports = ApplicationCommand;
|
||||
* @external APIApplicationCommandOption
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external ApplicationCommandOptionAllowedChannelTypes
|
||||
* @see {@link https://discord.js.org/#/docs/builders/main/typedef/ApplicationCommandOptionAllowedChannelTypes}
|
||||
*/
|
||||
|
||||
7
packages/discord.js/typings/index.d.ts
vendored
7
packages/discord.js/typings/index.d.ts
vendored
@@ -35,6 +35,7 @@ import {
|
||||
AnyComponentBuilder,
|
||||
ComponentBuilder,
|
||||
type RestOrArray,
|
||||
ApplicationCommandOptionAllowedChannelTypes,
|
||||
} from '@discordjs/builders';
|
||||
import { Awaitable, JSONEncodable } from '@discordjs/util';
|
||||
import { Collection } from '@discordjs/collection';
|
||||
@@ -4281,13 +4282,13 @@ export type ApplicationCommandData =
|
||||
|
||||
export interface ApplicationCommandChannelOptionData extends BaseApplicationCommandOptionsData {
|
||||
type: CommandOptionChannelResolvableType;
|
||||
channelTypes?: ChannelType[];
|
||||
channel_types?: ChannelType[];
|
||||
channelTypes?: ApplicationCommandOptionAllowedChannelTypes[];
|
||||
channel_types?: ApplicationCommandOptionAllowedChannelTypes[];
|
||||
}
|
||||
|
||||
export interface ApplicationCommandChannelOption extends BaseApplicationCommandOptionsData {
|
||||
type: ApplicationCommandOptionType.Channel;
|
||||
channelTypes?: ChannelType[];
|
||||
channelTypes?: ApplicationCommandOptionAllowedChannelTypes[];
|
||||
}
|
||||
|
||||
export interface ApplicationCommandRoleOptionData extends BaseApplicationCommandOptionsData {
|
||||
|
||||
Reference in New Issue
Block a user