Skip to content

Commit

Permalink
fix(typings): for intents (#3860)
Browse files Browse the repository at this point in the history
* re-introduce Intents export
* properly type WebsocketOptions#intents
  • Loading branch information
almostSouji committed Feb 29, 2020
1 parent 8a2f893 commit a6d3501
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions typings/index.d.ts
Expand Up @@ -980,6 +980,14 @@ declare module 'discord.js' {
public sync(): Promise<Integration>;
}

export class Intents extends BitField<IntentsString> {
public static FLAGS: Record<IntentsString, number>;
public static PRIVILEGED: number;
public static ALL: number;
public static NON_PRIVILEGED: number;
public static resolve(bit?: BitFieldResolvable<IntentsString>): number;
}

export class Invite extends Base {
constructor(client: Client, data: object);
public channel: GuildChannel | PartialGroupDMChannel;
Expand Down Expand Up @@ -2518,8 +2526,8 @@ declare module 'discord.js' {
permissionOverwrites?: OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>;
topic?: string;
type?: Exclude<
keyof typeof ChannelType | ChannelType,
'dm' | 'group' | 'unknown' | ChannelType.dm | ChannelType.group | ChannelType.unknown
keyof typeof ChannelType | ChannelType,
'dm' | 'group' | 'unknown' | ChannelType.dm | ChannelType.group | ChannelType.unknown
>;
nsfw?: boolean;
parent?: ChannelResolvable;
Expand Down Expand Up @@ -3002,7 +3010,7 @@ declare module 'discord.js' {
interface WebSocketOptions {
large_threshold?: number;
compress?: boolean;
intents?: Intents | number;
intents?: BitFieldResolvable<IntentsString> | number;
}

type WSEventType =
Expand Down

0 comments on commit a6d3501

Please sign in to comment.