fix: Narrow thread-related properties for channels (#1377)

This commit is contained in:
Nabil Ahmed
2025-10-03 16:48:44 +08:00
committed by GitHub
parent 7a07478721
commit 18cf4a514e
4 changed files with 36 additions and 28 deletions

View File

@@ -127,10 +127,6 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
permission_overwrites?: APIOverwrite[];
/**
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
*
* OR
*
* ID of the parent channel for a thread
*/
parent_id?: Snowflake | null;
/**
@@ -163,7 +159,9 @@ export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelT
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.GuildCategory>, APISortableChannel {}
export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.GuildCategory>, APISortableChannel {
parent_id?: null;
}
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
@@ -274,9 +272,9 @@ export interface APIThreadChannel<Type extends ThreadChannelType = ThreadChannel
*/
total_message_sent?: number;
/**
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
* ID of the parent channel for the thread
*/
applied_tags: Snowflake[];
parent_id?: Snowflake;
}
export type APIPublicThreadChannel = APIThreadChannel<ChannelType.PublicThread>;
@@ -399,6 +397,10 @@ export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | Channel
* The default sort order type used to order posts in a thread-only channel
*/
default_sort_order: SortOrderType | null;
/**
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
*/
applied_tags: Snowflake[];
}
export interface APIGuildForumChannel extends APIThreadOnlyChannel<ChannelType.GuildForum> {

View File

@@ -127,10 +127,6 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
permission_overwrites?: APIOverwrite[];
/**
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
*
* OR
*
* ID of the parent channel for a thread
*/
parent_id?: Snowflake | null;
/**
@@ -163,7 +159,9 @@ export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelT
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.GuildCategory>, APISortableChannel {}
export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.GuildCategory>, APISortableChannel {
parent_id?: null;
}
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
@@ -274,9 +272,9 @@ export interface APIThreadChannel<Type extends ThreadChannelType = ThreadChannel
*/
total_message_sent?: number;
/**
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
* ID of the parent channel for the thread
*/
applied_tags: Snowflake[];
parent_id?: Snowflake;
}
export type APIPublicThreadChannel = APIThreadChannel<ChannelType.PublicThread>;
@@ -399,6 +397,10 @@ export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | Channel
* The default sort order type used to order posts in a thread-only channel
*/
default_sort_order: SortOrderType | null;
/**
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
*/
applied_tags: Snowflake[];
}
export interface APIGuildForumChannel extends APIThreadOnlyChannel<ChannelType.GuildForum> {

View File

@@ -127,10 +127,6 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
permission_overwrites?: APIOverwrite[];
/**
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
*
* OR
*
* ID of the parent channel for a thread
*/
parent_id?: Snowflake | null;
/**
@@ -163,7 +159,9 @@ export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelT
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.GuildCategory>, APISortableChannel {}
export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.GuildCategory>, APISortableChannel {
parent_id?: null;
}
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
@@ -274,9 +272,9 @@ export interface APIThreadChannel<Type extends ThreadChannelType = ThreadChannel
*/
total_message_sent?: number;
/**
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
* ID of the parent channel for the thread
*/
applied_tags: Snowflake[];
parent_id?: Snowflake;
}
export type APIPublicThreadChannel = APIThreadChannel<ChannelType.PublicThread>;
@@ -399,6 +397,10 @@ export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | Channel
* The default sort order type used to order posts in a thread-only channel
*/
default_sort_order: SortOrderType | null;
/**
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
*/
applied_tags: Snowflake[];
}
export interface APIGuildForumChannel extends APIThreadOnlyChannel<ChannelType.GuildForum> {

View File

@@ -127,10 +127,6 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
permission_overwrites?: APIOverwrite[];
/**
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
*
* OR
*
* ID of the parent channel for a thread
*/
parent_id?: Snowflake | null;
/**
@@ -163,7 +159,9 @@ export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelT
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.GuildCategory>, APISortableChannel {}
export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.GuildCategory>, APISortableChannel {
parent_id?: null;
}
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
@@ -274,9 +272,9 @@ export interface APIThreadChannel<Type extends ThreadChannelType = ThreadChannel
*/
total_message_sent?: number;
/**
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
* ID of the parent channel for the thread
*/
applied_tags: Snowflake[];
parent_id?: Snowflake;
}
export type APIPublicThreadChannel = APIThreadChannel<ChannelType.PublicThread>;
@@ -399,6 +397,10 @@ export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | Channel
* The default sort order type used to order posts in a thread-only channel
*/
default_sort_order: SortOrderType | null;
/**
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
*/
applied_tags: Snowflake[];
}
export interface APIGuildForumChannel extends APIThreadOnlyChannel<ChannelType.GuildForum> {