Skip to content

types: rename CategoryChannelType to CategoryChannelChildTypes #10750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -904,16 +904,13 @@ export interface MappedChannelCategoryTypes {
[ChannelType.GuildMedia]: MediaChannel;
}

export type CategoryChannelType = Exclude<
ChannelType,
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.PublicThread
| ChannelType.AnnouncementThread
| ChannelType.PrivateThread
| ChannelType.GuildCategory
| ChannelType.GuildDirectory
>;
export type CategoryChannelChildTypes =
| ChannelType.GuildAnnouncement
| ChannelType.GuildVoice
| ChannelType.GuildText
| ChannelType.GuildStageVoice
| ChannelType.GuildForum
| ChannelType.GuildMedia;

export class CategoryChannel extends GuildChannel {
public get children(): CategoryChannelChildManager;
Expand Down Expand Up @@ -4010,7 +4007,7 @@ export class CategoryChannelChildManager extends DataManager<Snowflake, Category

public channel: CategoryChannel;
public get guild(): Guild;
public create<Type extends CategoryChannelType>(
public create<Type extends CategoryChannelChildTypes>(
options: CategoryCreateChannelOptions & { type: Type },
): Promise<MappedChannelCategoryTypes[Type]>;
public create(options: CategoryCreateChannelOptions): Promise<TextChannel>;
Expand Down Expand Up @@ -4108,7 +4105,7 @@ export type MappedGuildChannelTypes = {
[ChannelType.GuildCategory]: CategoryChannel;
} & MappedChannelCategoryTypes;

export type GuildChannelTypes = CategoryChannelType | ChannelType.GuildCategory;
export type GuildChannelTypes = CategoryChannelChildTypes | ChannelType.GuildCategory;

export class GuildChannelManager extends CachedManager<Snowflake, GuildBasedChannel, GuildChannelResolvable> {
private constructor(guild: Guild, iterable?: Iterable<RawGuildChannelData>);
Expand Down Expand Up @@ -5028,7 +5025,7 @@ export interface CategoryCreateChannelOptions {
name: string;
permissionOverwrites?: readonly OverwriteResolvable[] | ReadonlyCollection<Snowflake, OverwriteResolvable>;
topic?: string;
type?: CategoryChannelType;
type?: CategoryChannelChildTypes;
nsfw?: boolean;
bitrate?: number;
userLimit?: number;
Expand Down