From 53018e1d63e2fec9ea37c37b50cc8a635bad2687 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Thu, 27 Aug 2026 20:09:54 +0100 Subject: [PATCH] fix: correct `available_tags` types (#1778) --- deno/payloads/v10/channel.ts | 2 +- deno/payloads/v9/channel.ts | 2 +- deno/rest/v10/channel.ts | 19 +++++++++++++++++-- deno/rest/v10/guild.ts | 9 ++++++--- deno/rest/v9/channel.ts | 19 +++++++++++++++++-- deno/rest/v9/guild.ts | 9 ++++++--- payloads/v10/channel.ts | 2 +- payloads/v9/channel.ts | 2 +- rest/v10/channel.ts | 19 +++++++++++++++++-- rest/v10/guild.ts | 9 ++++++--- rest/v9/channel.ts | 19 +++++++++++++++++-- rest/v9/guild.ts | 9 ++++++--- 12 files changed, 96 insertions(+), 24 deletions(-) diff --git a/deno/payloads/v10/channel.ts b/deno/payloads/v10/channel.ts index 508fd08d..86a8bcc4 100644 --- a/deno/payloads/v10/channel.ts +++ b/deno/payloads/v10/channel.ts @@ -283,7 +283,7 @@ export type APIPrivateThreadChannel = APIThreadChannel; /** - * @see {@link https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure} + * @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object} */ export interface APIGuildForumTag { /** diff --git a/deno/payloads/v9/channel.ts b/deno/payloads/v9/channel.ts index 09439d69..859bf9b6 100644 --- a/deno/payloads/v9/channel.ts +++ b/deno/payloads/v9/channel.ts @@ -278,7 +278,7 @@ export type APIPrivateThreadChannel = APIThreadChannel; /** - * @see {@link https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure} + * @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object} */ export interface APIGuildForumTag { /** diff --git a/deno/rest/v10/channel.ts b/deno/rest/v10/channel.ts index e73d2ed5..c3f79708 100644 --- a/deno/rest/v10/channel.ts +++ b/deno/rest/v10/channel.ts @@ -41,13 +41,28 @@ export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissio */ export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite; +/** + * A forum tag in a create channel request. + * + * @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object} + */ +export type RESTPostAPIGuildChannelForumTagJSONBody = _StrictPartial> & + Pick; + +/** + * A forum tag in an update channel request. + * + * @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object} + */ +export type RESTPatchAPIChannelForumTagJSONBody = _StrictPartial & Pick; + /** * @see {@link https://discord.com/developers/docs/resources/channel#get-channel} */ export type RESTGetAPIChannelResult = APIChannel; /** - * @see {@link https://discord.com/developers/docs/resources/channel#modify-channel} + * @see {@link https://docs.discord.com/developers/resources/channel#modify-channel} */ export interface RESTPatchAPIChannelJSONBody { /** @@ -158,7 +173,7 @@ export interface RESTPatchAPIChannelJSONBody { * * Channel types: forum, media */ - available_tags?: (Partial & Pick)[] | undefined; + available_tags?: RESTPatchAPIChannelForumTagJSONBody[] | undefined; /** * Whether non-moderators can add other non-moderators to the thread * diff --git a/deno/rest/v10/guild.ts b/deno/rest/v10/guild.ts index 17b9c9c0..fe8c8c43 100644 --- a/deno/rest/v10/guild.ts +++ b/deno/rest/v10/guild.ts @@ -46,7 +46,7 @@ import type { _StrictRequired, } from '../../utils/internals.ts'; import type { Locale } from '../common.ts'; -import type { RESTPutAPIChannelPermissionJSONBody } from './channel.ts'; +import type { RESTPostAPIGuildChannelForumTagJSONBody, RESTPutAPIChannelPermissionJSONBody } from './channel.ts'; export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: number | string; @@ -67,7 +67,6 @@ export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable; export type RESTAPIGuildCreatePartialChannel = _StrictPartial< _DistributivePick< RESTAPIGuildChannelResolvable, - | 'available_tags' | 'bitrate' | 'default_auto_archive_duration' | 'default_forum_layout' @@ -86,6 +85,10 @@ export type RESTAPIGuildCreatePartialChannel = _StrictPartial< > > & { name: string; + /** + * The set of tags that can be used in a thread-only channel; limited to 20 + */ + available_tags?: RESTPostAPIGuildChannelForumTagJSONBody[] | null | undefined; id?: number | string | undefined; parent_id?: number | string | null | undefined; permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined; @@ -368,7 +371,7 @@ export type RESTDeleteAPIGuildResult = undefined; export type RESTGetAPIGuildChannelsResult = APIGuildChannel[]; /** - * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel} + * @see {@link https://docs.discord.com/developers/resources/guild#create-guild-channel} */ export type RESTPostAPIGuildChannelJSONBody = _DistributiveOmit; diff --git a/deno/rest/v9/channel.ts b/deno/rest/v9/channel.ts index 1fc3d9f3..faa46a7d 100644 --- a/deno/rest/v9/channel.ts +++ b/deno/rest/v9/channel.ts @@ -41,13 +41,28 @@ export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissio */ export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite; +/** + * A forum tag in a create channel request. + * + * @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object} + */ +export type RESTPostAPIGuildChannelForumTagJSONBody = _StrictPartial> & + Pick; + +/** + * A forum tag in an update channel request. + * + * @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object} + */ +export type RESTPatchAPIChannelForumTagJSONBody = _StrictPartial & Pick; + /** * @see {@link https://discord.com/developers/docs/resources/channel#get-channel} */ export type RESTGetAPIChannelResult = APIChannel; /** - * @see {@link https://discord.com/developers/docs/resources/channel#modify-channel} + * @see {@link https://docs.discord.com/developers/resources/channel#modify-channel} */ export interface RESTPatchAPIChannelJSONBody { /** @@ -158,7 +173,7 @@ export interface RESTPatchAPIChannelJSONBody { * * Channel types: forum, media */ - available_tags?: (Partial & Pick)[] | undefined; + available_tags?: RESTPatchAPIChannelForumTagJSONBody[] | undefined; /** * Whether non-moderators can add other non-moderators to the thread * diff --git a/deno/rest/v9/guild.ts b/deno/rest/v9/guild.ts index 3bce8510..7eaf3fcb 100644 --- a/deno/rest/v9/guild.ts +++ b/deno/rest/v9/guild.ts @@ -46,7 +46,7 @@ import type { _StrictRequired, } from '../../utils/internals.ts'; import type { Locale } from '../common.ts'; -import type { RESTPutAPIChannelPermissionJSONBody } from './channel.ts'; +import type { RESTPostAPIGuildChannelForumTagJSONBody, RESTPutAPIChannelPermissionJSONBody } from './channel.ts'; export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: number | string; @@ -67,7 +67,6 @@ export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable; export type RESTAPIGuildCreatePartialChannel = _StrictPartial< _DistributivePick< RESTAPIGuildChannelResolvable, - | 'available_tags' | 'bitrate' | 'default_auto_archive_duration' | 'default_forum_layout' @@ -86,6 +85,10 @@ export type RESTAPIGuildCreatePartialChannel = _StrictPartial< > > & { name: string; + /** + * The set of tags that can be used in a thread-only channel; limited to 20 + */ + available_tags?: RESTPostAPIGuildChannelForumTagJSONBody[] | null | undefined; id?: number | string | undefined; parent_id?: number | string | null | undefined; permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined; @@ -368,7 +371,7 @@ export type RESTDeleteAPIGuildResult = undefined; export type RESTGetAPIGuildChannelsResult = APIGuildChannel[]; /** - * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel} + * @see {@link https://docs.discord.com/developers/resources/guild#create-guild-channel} */ export type RESTPostAPIGuildChannelJSONBody = _DistributiveOmit; diff --git a/payloads/v10/channel.ts b/payloads/v10/channel.ts index 7729767c..1855f34f 100644 --- a/payloads/v10/channel.ts +++ b/payloads/v10/channel.ts @@ -283,7 +283,7 @@ export type APIPrivateThreadChannel = APIThreadChannel; /** - * @see {@link https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure} + * @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object} */ export interface APIGuildForumTag { /** diff --git a/payloads/v9/channel.ts b/payloads/v9/channel.ts index 44517337..8d0fd13f 100644 --- a/payloads/v9/channel.ts +++ b/payloads/v9/channel.ts @@ -278,7 +278,7 @@ export type APIPrivateThreadChannel = APIThreadChannel; /** - * @see {@link https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure} + * @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object} */ export interface APIGuildForumTag { /** diff --git a/rest/v10/channel.ts b/rest/v10/channel.ts index ebb47a4b..3a11ca9c 100644 --- a/rest/v10/channel.ts +++ b/rest/v10/channel.ts @@ -41,13 +41,28 @@ export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissio */ export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite; +/** + * A forum tag in a create channel request. + * + * @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object} + */ +export type RESTPostAPIGuildChannelForumTagJSONBody = _StrictPartial> & + Pick; + +/** + * A forum tag in an update channel request. + * + * @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object} + */ +export type RESTPatchAPIChannelForumTagJSONBody = _StrictPartial & Pick; + /** * @see {@link https://discord.com/developers/docs/resources/channel#get-channel} */ export type RESTGetAPIChannelResult = APIChannel; /** - * @see {@link https://discord.com/developers/docs/resources/channel#modify-channel} + * @see {@link https://docs.discord.com/developers/resources/channel#modify-channel} */ export interface RESTPatchAPIChannelJSONBody { /** @@ -158,7 +173,7 @@ export interface RESTPatchAPIChannelJSONBody { * * Channel types: forum, media */ - available_tags?: (Partial & Pick)[] | undefined; + available_tags?: RESTPatchAPIChannelForumTagJSONBody[] | undefined; /** * Whether non-moderators can add other non-moderators to the thread * diff --git a/rest/v10/guild.ts b/rest/v10/guild.ts index 3198c6c0..8d6c8370 100644 --- a/rest/v10/guild.ts +++ b/rest/v10/guild.ts @@ -46,7 +46,7 @@ import type { _StrictRequired, } from '../../utils/internals'; import type { Locale } from '../common'; -import type { RESTPutAPIChannelPermissionJSONBody } from './channel'; +import type { RESTPostAPIGuildChannelForumTagJSONBody, RESTPutAPIChannelPermissionJSONBody } from './channel'; export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: number | string; @@ -67,7 +67,6 @@ export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable; export type RESTAPIGuildCreatePartialChannel = _StrictPartial< _DistributivePick< RESTAPIGuildChannelResolvable, - | 'available_tags' | 'bitrate' | 'default_auto_archive_duration' | 'default_forum_layout' @@ -86,6 +85,10 @@ export type RESTAPIGuildCreatePartialChannel = _StrictPartial< > > & { name: string; + /** + * The set of tags that can be used in a thread-only channel; limited to 20 + */ + available_tags?: RESTPostAPIGuildChannelForumTagJSONBody[] | null | undefined; id?: number | string | undefined; parent_id?: number | string | null | undefined; permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined; @@ -368,7 +371,7 @@ export type RESTDeleteAPIGuildResult = undefined; export type RESTGetAPIGuildChannelsResult = APIGuildChannel[]; /** - * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel} + * @see {@link https://docs.discord.com/developers/resources/guild#create-guild-channel} */ export type RESTPostAPIGuildChannelJSONBody = _DistributiveOmit; diff --git a/rest/v9/channel.ts b/rest/v9/channel.ts index b8f5217a..26ee5e55 100644 --- a/rest/v9/channel.ts +++ b/rest/v9/channel.ts @@ -41,13 +41,28 @@ export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissio */ export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite; +/** + * A forum tag in a create channel request. + * + * @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object} + */ +export type RESTPostAPIGuildChannelForumTagJSONBody = _StrictPartial> & + Pick; + +/** + * A forum tag in an update channel request. + * + * @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object} + */ +export type RESTPatchAPIChannelForumTagJSONBody = _StrictPartial & Pick; + /** * @see {@link https://discord.com/developers/docs/resources/channel#get-channel} */ export type RESTGetAPIChannelResult = APIChannel; /** - * @see {@link https://discord.com/developers/docs/resources/channel#modify-channel} + * @see {@link https://docs.discord.com/developers/resources/channel#modify-channel} */ export interface RESTPatchAPIChannelJSONBody { /** @@ -158,7 +173,7 @@ export interface RESTPatchAPIChannelJSONBody { * * Channel types: forum, media */ - available_tags?: (Partial & Pick)[] | undefined; + available_tags?: RESTPatchAPIChannelForumTagJSONBody[] | undefined; /** * Whether non-moderators can add other non-moderators to the thread * diff --git a/rest/v9/guild.ts b/rest/v9/guild.ts index 82fef84f..1dd12523 100644 --- a/rest/v9/guild.ts +++ b/rest/v9/guild.ts @@ -46,7 +46,7 @@ import type { _StrictRequired, } from '../../utils/internals'; import type { Locale } from '../common'; -import type { RESTPutAPIChannelPermissionJSONBody } from './channel'; +import type { RESTPostAPIGuildChannelForumTagJSONBody, RESTPutAPIChannelPermissionJSONBody } from './channel'; export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: number | string; @@ -67,7 +67,6 @@ export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable; export type RESTAPIGuildCreatePartialChannel = _StrictPartial< _DistributivePick< RESTAPIGuildChannelResolvable, - | 'available_tags' | 'bitrate' | 'default_auto_archive_duration' | 'default_forum_layout' @@ -86,6 +85,10 @@ export type RESTAPIGuildCreatePartialChannel = _StrictPartial< > > & { name: string; + /** + * The set of tags that can be used in a thread-only channel; limited to 20 + */ + available_tags?: RESTPostAPIGuildChannelForumTagJSONBody[] | null | undefined; id?: number | string | undefined; parent_id?: number | string | null | undefined; permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined; @@ -368,7 +371,7 @@ export type RESTDeleteAPIGuildResult = undefined; export type RESTGetAPIGuildChannelsResult = APIGuildChannel[]; /** - * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel} + * @see {@link https://docs.discord.com/developers/resources/guild#create-guild-channel} */ export type RESTPostAPIGuildChannelJSONBody = _DistributiveOmit;