feat: application command option allowed channel type (#1548)

This commit is contained in:
Denis-Adrian Cristea
2026-03-05 15:53:53 +02:00
committed by GitHub
parent cef79b442e
commit 5ea94a6629
4 changed files with 14 additions and 4 deletions

View File

@@ -1,10 +1,10 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';
import type { ApplicationCommandOptionAllowedChannelType } from '../../../channel.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
export interface APIApplicationCommandChannelOption extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildDirectory>[];
channel_types?: ApplicationCommandOptionAllowedChannelType[];
}
export type APIApplicationCommandInteractionDataChannelOption = APIInteractionDataOptionBase<

View File

@@ -75,6 +75,11 @@ export type TextChannelType =
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export type ApplicationCommandOptionAllowedChannelType = Exclude<
ChannelType,
ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildDirectory
>;
export interface APISlowmodeChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* Amount of seconds a user has to wait before sending another message (0-21600);

View File

@@ -1,10 +1,10 @@
import type { Snowflake } from '../../../../../globals';
import type { ChannelType } from '../../../channel';
import type { ApplicationCommandOptionAllowedChannelType } from '../../../channel';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base';
import type { ApplicationCommandOptionType } from './shared';
export interface APIApplicationCommandChannelOption extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildDirectory>[];
channel_types?: ApplicationCommandOptionAllowedChannelType[];
}
export type APIApplicationCommandInteractionDataChannelOption = APIInteractionDataOptionBase<

View File

@@ -75,6 +75,11 @@ export type TextChannelType =
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export type ApplicationCommandOptionAllowedChannelType = Exclude<
ChannelType,
ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildDirectory
>;
export interface APISlowmodeChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* Amount of seconds a user has to wait before sending another message (0-21600);