fix: correct available_tags types (#1778)

This commit is contained in:
Jiralite
2026-08-27 22:09:54 +03:00
committed by GitHub
parent e6e07a7210
commit 53018e1d63
12 changed files with 96 additions and 24 deletions
+1 -1
View File
@@ -283,7 +283,7 @@ export type APIPrivateThreadChannel = APIThreadChannel<ChannelType.PrivateThread
export type APIAnnouncementThreadChannel = APIThreadChannel<ChannelType.AnnouncementThread>;
/**
* @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 {
/**
+1 -1
View File
@@ -278,7 +278,7 @@ export type APIPrivateThreadChannel = APIThreadChannel<ChannelType.PrivateThread
export type APIAnnouncementThreadChannel = APIThreadChannel<ChannelType.AnnouncementThread>;
/**
* @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 {
/**
+17 -2
View File
@@ -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<Omit<APIGuildForumTag, 'id'>> &
Pick<APIGuildForumTag, 'name'>;
/**
* A forum tag in an update channel request.
*
* @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object}
*/
export type RESTPatchAPIChannelForumTagJSONBody = _StrictPartial<APIGuildForumTag> & Pick<APIGuildForumTag, 'name'>;
/**
* @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<APIGuildForumTag> & Pick<APIGuildForumTag, 'name'>)[] | undefined;
available_tags?: RESTPatchAPIChannelForumTagJSONBody[] | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread
*
+6 -3
View File
@@ -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<RESTAPIGuildCreatePartialChannel, 'id'>;
+17 -2
View File
@@ -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<Omit<APIGuildForumTag, 'id'>> &
Pick<APIGuildForumTag, 'name'>;
/**
* A forum tag in an update channel request.
*
* @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object}
*/
export type RESTPatchAPIChannelForumTagJSONBody = _StrictPartial<APIGuildForumTag> & Pick<APIGuildForumTag, 'name'>;
/**
* @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<APIGuildForumTag> & Pick<APIGuildForumTag, 'name'>)[] | undefined;
available_tags?: RESTPatchAPIChannelForumTagJSONBody[] | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread
*
+6 -3
View File
@@ -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<RESTAPIGuildCreatePartialChannel, 'id'>;
+1 -1
View File
@@ -283,7 +283,7 @@ export type APIPrivateThreadChannel = APIThreadChannel<ChannelType.PrivateThread
export type APIAnnouncementThreadChannel = APIThreadChannel<ChannelType.AnnouncementThread>;
/**
* @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 {
/**
+1 -1
View File
@@ -278,7 +278,7 @@ export type APIPrivateThreadChannel = APIThreadChannel<ChannelType.PrivateThread
export type APIAnnouncementThreadChannel = APIThreadChannel<ChannelType.AnnouncementThread>;
/**
* @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 {
/**
+17 -2
View File
@@ -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<Omit<APIGuildForumTag, 'id'>> &
Pick<APIGuildForumTag, 'name'>;
/**
* A forum tag in an update channel request.
*
* @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object}
*/
export type RESTPatchAPIChannelForumTagJSONBody = _StrictPartial<APIGuildForumTag> & Pick<APIGuildForumTag, 'name'>;
/**
* @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<APIGuildForumTag> & Pick<APIGuildForumTag, 'name'>)[] | undefined;
available_tags?: RESTPatchAPIChannelForumTagJSONBody[] | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread
*
+6 -3
View File
@@ -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<RESTAPIGuildCreatePartialChannel, 'id'>;
+17 -2
View File
@@ -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<Omit<APIGuildForumTag, 'id'>> &
Pick<APIGuildForumTag, 'name'>;
/**
* A forum tag in an update channel request.
*
* @see {@link https://docs.discord.com/developers/resources/channel#forum-tag-object}
*/
export type RESTPatchAPIChannelForumTagJSONBody = _StrictPartial<APIGuildForumTag> & Pick<APIGuildForumTag, 'name'>;
/**
* @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<APIGuildForumTag> & Pick<APIGuildForumTag, 'name'>)[] | undefined;
available_tags?: RESTPatchAPIChannelForumTagJSONBody[] | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread
*
+6 -3
View File
@@ -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<RESTAPIGuildCreatePartialChannel, 'id'>;