mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-30 23:40:09 +00:00
feat(APIApplicationCommand): add channel_types field to channel options (#198)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { APIRole, APIUser } from '../../mod.ts';
|
||||
import type { APIRole, APIUser, ChannelType } from '../../mod.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type {
|
||||
@@ -13,7 +13,6 @@ interface APIApplicationCommandOptionBase {
|
||||
type:
|
||||
| ApplicationCommandOptionType.Boolean
|
||||
| ApplicationCommandOptionType.User
|
||||
| ApplicationCommandOptionType.Channel
|
||||
| ApplicationCommandOptionType.Role
|
||||
| ApplicationCommandOptionType.Mentionable;
|
||||
name: string;
|
||||
@@ -28,6 +27,7 @@ interface APIApplicationCommandOptionBase {
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandArgumentOptions
|
||||
| APIApplicationCommandSubCommandOptions
|
||||
| APIApplicationCommandChannelOptions
|
||||
| APIApplicationCommandOptionBase;
|
||||
|
||||
/**
|
||||
@@ -54,6 +54,17 @@ export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicatio
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions` and `APIApplicationCommandArgumentOptions`,
|
||||
* these types cannot have an `options` array, or a `choices` array, but they can have a `channel_types` one.
|
||||
*/
|
||||
export interface APIApplicationCommandChannelOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.Channel;
|
||||
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { APIRole, APIUser } from '../../mod.ts';
|
||||
import type { APIRole, APIUser, ChannelType } from '../../mod.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type {
|
||||
@@ -13,7 +13,6 @@ interface APIApplicationCommandOptionBase {
|
||||
type:
|
||||
| ApplicationCommandOptionType.Boolean
|
||||
| ApplicationCommandOptionType.User
|
||||
| ApplicationCommandOptionType.Channel
|
||||
| ApplicationCommandOptionType.Role
|
||||
| ApplicationCommandOptionType.Mentionable;
|
||||
name: string;
|
||||
@@ -28,6 +27,7 @@ interface APIApplicationCommandOptionBase {
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandArgumentOptions
|
||||
| APIApplicationCommandSubCommandOptions
|
||||
| APIApplicationCommandChannelOptions
|
||||
| APIApplicationCommandOptionBase;
|
||||
|
||||
/**
|
||||
@@ -54,6 +54,17 @@ export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicatio
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions` and `APIApplicationCommandArgumentOptions`,
|
||||
* these types cannot have an `options` array, or a `choices` array, but they can have a `channel_types` one.
|
||||
*/
|
||||
export interface APIApplicationCommandChannelOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.Channel;
|
||||
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { APIRole, APIUser } from '../../index';
|
||||
import type { APIRole, APIUser, ChannelType } from '../../index';
|
||||
import type { Snowflake } from '../../../../globals';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base';
|
||||
import type {
|
||||
@@ -13,7 +13,6 @@ interface APIApplicationCommandOptionBase {
|
||||
type:
|
||||
| ApplicationCommandOptionType.Boolean
|
||||
| ApplicationCommandOptionType.User
|
||||
| ApplicationCommandOptionType.Channel
|
||||
| ApplicationCommandOptionType.Role
|
||||
| ApplicationCommandOptionType.Mentionable;
|
||||
name: string;
|
||||
@@ -28,6 +27,7 @@ interface APIApplicationCommandOptionBase {
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandArgumentOptions
|
||||
| APIApplicationCommandSubCommandOptions
|
||||
| APIApplicationCommandChannelOptions
|
||||
| APIApplicationCommandOptionBase;
|
||||
|
||||
/**
|
||||
@@ -54,6 +54,17 @@ export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicatio
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions` and `APIApplicationCommandArgumentOptions`,
|
||||
* these types cannot have an `options` array, or a `choices` array, but they can have a `channel_types` one.
|
||||
*/
|
||||
export interface APIApplicationCommandChannelOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.Channel;
|
||||
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { APIRole, APIUser } from '../../index';
|
||||
import type { APIRole, APIUser, ChannelType } from '../../index';
|
||||
import type { Snowflake } from '../../../../globals';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base';
|
||||
import type {
|
||||
@@ -13,7 +13,6 @@ interface APIApplicationCommandOptionBase {
|
||||
type:
|
||||
| ApplicationCommandOptionType.Boolean
|
||||
| ApplicationCommandOptionType.User
|
||||
| ApplicationCommandOptionType.Channel
|
||||
| ApplicationCommandOptionType.Role
|
||||
| ApplicationCommandOptionType.Mentionable;
|
||||
name: string;
|
||||
@@ -28,6 +27,7 @@ interface APIApplicationCommandOptionBase {
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandArgumentOptions
|
||||
| APIApplicationCommandSubCommandOptions
|
||||
| APIApplicationCommandChannelOptions
|
||||
| APIApplicationCommandOptionBase;
|
||||
|
||||
/**
|
||||
@@ -54,6 +54,17 @@ export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicatio
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions` and `APIApplicationCommandArgumentOptions`,
|
||||
* these types cannot have an `options` array, or a `choices` array, but they can have a `channel_types` one.
|
||||
*/
|
||||
export interface APIApplicationCommandChannelOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.Channel;
|
||||
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user