mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
typings: Refactor how channel types are done (#3808)
* refactor channel types * really weird solution to make what the PR promises possible, I might revert this * undo the dumb attempt * Update index.d.ts * fix GuildCreateChannelOptions#type * fix(typings): remove initializers from the enum * Update index.d.ts Co-authored-by: Crawl <icrawltogo@gmail.com>
This commit is contained in:
11
typings/index.d.ts
vendored
11
typings/index.d.ts
vendored
@@ -133,6 +133,7 @@ declare module 'discord.js' {
|
|||||||
|
|
||||||
export class CategoryChannel extends GuildChannel {
|
export class CategoryChannel extends GuildChannel {
|
||||||
public readonly children: Collection<Snowflake, GuildChannel>;
|
public readonly children: Collection<Snowflake, GuildChannel>;
|
||||||
|
public type: 'category';
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Channel extends Base {
|
export class Channel extends Base {
|
||||||
@@ -689,6 +690,7 @@ declare module 'discord.js' {
|
|||||||
public messages: MessageManager;
|
public messages: MessageManager;
|
||||||
public recipient: User;
|
public recipient: User;
|
||||||
public readonly partial: false;
|
public readonly partial: false;
|
||||||
|
public type: 'dm';
|
||||||
public fetch(): Promise<DMChannel>;
|
public fetch(): Promise<DMChannel>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -861,6 +863,7 @@ declare module 'discord.js' {
|
|||||||
public readonly permissionsLocked: boolean | null;
|
public readonly permissionsLocked: boolean | null;
|
||||||
public readonly position: number;
|
public readonly position: number;
|
||||||
public rawPosition: number;
|
public rawPosition: number;
|
||||||
|
public type: Exclude<keyof typeof ChannelType, 'dm' | 'group' | 'unknown'>;
|
||||||
public readonly viewable: boolean;
|
public readonly viewable: boolean;
|
||||||
public clone(options?: GuildChannelCloneOptions): Promise<this>;
|
public clone(options?: GuildChannelCloneOptions): Promise<this>;
|
||||||
public createInvite(options?: InviteOptions): Promise<Invite>;
|
public createInvite(options?: InviteOptions): Promise<Invite>;
|
||||||
@@ -1211,6 +1214,7 @@ declare module 'discord.js' {
|
|||||||
public messages: MessageManager;
|
public messages: MessageManager;
|
||||||
public nsfw: boolean;
|
public nsfw: boolean;
|
||||||
public topic: string | null;
|
public topic: string | null;
|
||||||
|
public type: 'news';
|
||||||
public createWebhook(
|
public createWebhook(
|
||||||
name: string,
|
name: string,
|
||||||
options?: { avatar?: BufferResolvable | Base64Resolvable; reason?: string },
|
options?: { avatar?: BufferResolvable | Base64Resolvable; reason?: string },
|
||||||
@@ -1546,6 +1550,7 @@ declare module 'discord.js' {
|
|||||||
constructor(guild: Guild, data?: object);
|
constructor(guild: Guild, data?: object);
|
||||||
public messages: MessageManager;
|
public messages: MessageManager;
|
||||||
public nsfw: boolean;
|
public nsfw: boolean;
|
||||||
|
public type: 'text';
|
||||||
public rateLimitPerUser: number;
|
public rateLimitPerUser: number;
|
||||||
public topic: string | null;
|
public topic: string | null;
|
||||||
public createWebhook(
|
public createWebhook(
|
||||||
@@ -1654,6 +1659,7 @@ declare module 'discord.js' {
|
|||||||
public readonly full: boolean;
|
public readonly full: boolean;
|
||||||
public readonly joinable: boolean;
|
public readonly joinable: boolean;
|
||||||
public readonly speakable: boolean;
|
public readonly speakable: boolean;
|
||||||
|
public type: 'voice';
|
||||||
public userLimit: number;
|
public userLimit: number;
|
||||||
public join(): Promise<VoiceConnection>;
|
public join(): Promise<VoiceConnection>;
|
||||||
public leave(): void;
|
public leave(): void;
|
||||||
@@ -2512,7 +2518,10 @@ declare module 'discord.js' {
|
|||||||
interface GuildCreateChannelOptions {
|
interface GuildCreateChannelOptions {
|
||||||
permissionOverwrites?: OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>;
|
permissionOverwrites?: OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>;
|
||||||
topic?: string;
|
topic?: string;
|
||||||
type?: Exclude<keyof typeof ChannelType, 'dm' | 'group' | 'unknown'>;
|
type?: Exclude<
|
||||||
|
keyof typeof ChannelType | ChannelType,
|
||||||
|
'dm' | 'group' | 'unknown' | ChannelType.dm | ChannelType.group | ChannelType.unknown
|
||||||
|
>;
|
||||||
nsfw?: boolean;
|
nsfw?: boolean;
|
||||||
parent?: ChannelResolvable;
|
parent?: ChannelResolvable;
|
||||||
bitrate?: number;
|
bitrate?: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user