diff --git a/typings/index.d.ts b/typings/index.d.ts index 7f7b59927..2b7c5132d 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -104,23 +104,18 @@ declare module 'discord.js' { public users: UserStore; public readonly voiceConnections: Collection; public createVoiceBroadcast(): VoiceBroadcast; - public destroy(): Promise; - public fetchApplication(id?: Snowflake): Promise; + public fetchApplication(): Promise; public fetchInvite(invite: InviteResolvable): Promise; public fetchVoiceRegions(): Promise>; public fetchWebhook(id: Snowflake, token?: string): Promise; public generateInvite(permissions?: number | PermissionResolvable[]): Promise; public login(token?: string): Promise; public sweepMessages(lifetime?: number): number; - public syncGuilds(guilds?: Guild[] | Collection): void; public toJSON(): object; public on(event: 'channelCreate' | 'channelDelete', listener: (channel: Channel) => void): this; public on(event: 'channelPinsUpdate', listener: (channel: Channel, time: Date) => void): this; public on(event: 'channelUpdate', listener: (oldChannel: Channel, newChannel: Channel) => void): this; - public on(event: 'clientUserGuildSettingsUpdate', listener: (clientUserGuildSettings: ClientUserGuildSettings) => void): this; - public on(event: 'clientUserSettingsUpdate', listener: (clientUserSettings: ClientUserSettings) => void): this; - public on(event: 'clientUserGuildSettingsUpdate', listener: (clientUserGuildSettings: ClientUserGuildSettings) => void): this; public on(event: 'debug' | 'warn', listener: (info: string) => void): this; public on(event: 'disconnect', listener: (event: any) => void): this; public on(event: 'emojiCreate' | 'emojiDelete', listener: (emoji: GuildEmoji) => void): this; @@ -144,7 +139,6 @@ declare module 'discord.js' { public on(event: 'roleCreate' | 'roleDelete', listener: (role: Role) => void): this; public on(event: 'roleUpdate', listener: (oldRole: Role, newRole: Role) => void): this; public on(event: 'typingStart' | 'typingStop', listener: (channel: Channel, user: User) => void): this; - public on(event: 'userNoteUpdate', listener: (user: UserResolvable, oldNote: string, newNote: string) => void): this; public on(event: 'userUpdate', listener: (oldUser: User, newUser: User) => void): this; public once(event: 'voiceStateUpdate', listener: (oldState: VoiceState, newState: VoiceState) => void): this; public on(event: string, listener: Function): this; @@ -152,9 +146,6 @@ declare module 'discord.js' { public once(event: 'channelCreate' | 'channelDelete', listener: (channel: Channel) => void): this; public once(event: 'channelPinsUpdate', listener: (channel: Channel, time: Date) => void): this; public once(event: 'channelUpdate', listener: (oldChannel: Channel, newChannel: Channel) => void): this; - public once(event: 'clientUserGuildSettingsUpdate', listener: (clientUserGuildSettings: ClientUserGuildSettings) => void): this; - public once(event: 'clientUserSettingsUpdate', listener: (clientUserSettings: ClientUserSettings) => void): this; - public once(event: 'clientUserGuildSettingsUpdate', listener: (clientUserGuildSettings: ClientUserGuildSettings) => void): this; public once(event: 'debug' | 'warn', listener: (info: string) => void): this; public once(event: 'disconnect', listener: (event: any) => void): this; public once(event: 'emojiCreate' | 'emojiDelete', listener: (emoji: GuildEmoji) => void): this; @@ -178,7 +169,6 @@ declare module 'discord.js' { public once(event: 'roleCreate' | 'roleDelete', listener: (role: Role) => void): this; public once(event: 'roleUpdate', listener: (oldRole: Role, newRole: Role) => void): this; public once(event: 'typingStart' | 'typingStop', listener: (channel: Channel, user: User) => void): this; - public once(event: 'userNoteUpdate', listener: (user: UserResolvable, oldNote: string, newNote: string) => void): this; public once(event: 'userUpdate', listener: (oldUser: User, newUser: User) => void): this; public once(event: 'voiceStateUpdate', listener: (oldState: VoiceState, newState: VoiceState) => void): this; public once(event: string, listener: Function): this; @@ -205,8 +195,6 @@ declare module 'discord.js' { public createAsset(name: string, data: Base64Resolvable, type: 'big' | 'small' | 'Big' | 'Small'): Promise; public fetchAssets(): Promise; public iconURL(options?: AvatarOptions): string; - public resetSecret(): Promise; - public resetToken(): Promise; public toJSON(): object; public toString(): string; } @@ -220,76 +208,15 @@ declare module 'discord.js' { } export class ClientUser extends User { - public blocked: Collection; - public email: string; - public friends: Collection; - public guildSettings: Collection; public mfaEnabled: boolean; - public mobile: boolean; - public notes: Collection; - public premium: boolean; - public settings: ClientUserSettings; public verified: boolean; public createGroupDM(recipients: GroupDMRecipientOptions[]): Promise; - public fetchMentions(options?: { limit?: number; roles?: boolean, everyone?: boolean; guild?: Guild | Snowflake }): Promise; public setActivity(name: string, options?: { url?: string, type?: ActivityType | number }): Promise; public setAFK(afk: boolean): Promise; public setAvatar(avatar: BufferResolvable | Base64Resolvable): Promise; - public setEmail(email: string, password: string): Promise; - public setPassword(newPassword: string, options: { oldPassword?: string, mfaCode?: string }): Promise; public setPresence(data: PresenceData): Promise; public setStatus(status: PresenceStatus): Promise; - public setUsername(username: string, password?: string): Promise; - public toJSON(): object; - } - - export class ClientUserChannelOverride { - constructor(data: object); - private patch(data: object): void; - - public messageNotifications: GuildChannelMessageNotifications; - public muted: boolean; - } - - export class ClientUserGuildSettings { - constructor(client: Client, data: object); - private patch(data: object): void; - private update(name: string, value: any): Promise; - - public channelOverrides: Collection; - public readonly client: Client; - public guildID: Snowflake; - public messageNotifications: GuildChannelMessageNotifications; - public mobilePush: boolean; - public muted: boolean; - public suppressEveryone: boolean; - } - - export class ClientUserSettings { - constructor(user: User, data: object); - private update(name: string, value: any): Promise; - private patch(data: object): void; - - public convertEmoticons: boolean; - public defaultGuildsRestricted: boolean; - public detectPlatformAccounts: boolean; - public developerMode: boolean; - public enableTTSCommand: boolean; - public explicitContentFilter: 'DISABLED' | 'NON_FRIENDS' | 'FRIENDS_AND_NON_FRIENDS'; - public friendsSources: { all: boolean, mutualGuilds: boolean, mutualFriends: boolean }; - public guildsPositions: Snowflake[]; - public inlineAttachmentMedia: boolean; - public inlineEmbedMedia: boolean; - public locale: string; - public messageDisplayCompact: boolean; - public renderReactions: boolean; - public restrictedGuilds: Snowflake[]; - public showCurrentGame: boolean; - public status: PresenceStatus; - public theme: string; - public addRestrictedGuild(guild: Guild): Promise; - public removeRestrictedGuild(guild: Guild): Promise; - public setGuildPosition(guild: Guild, position: number, relative?: boolean): Promise; + public setUsername(username: string): Promise; } export class Collection extends Map { @@ -442,28 +369,21 @@ declare module 'discord.js' { public readonly me: GuildMember; public memberCount: number; public members: GuildMemberStore; - public readonly messageNotifications: MessageNotifications; public mfaLevel: number; - public readonly mobilePush: boolean; - public readonly muted: boolean; public name: string; public readonly nameAcronym: string; public readonly owner: GuildMember; public ownerID: Snowflake; - public readonly position: number; public presences: PresenceStore; public region: string; public roles: RoleStore; public splash: string; - public readonly suppressEveryone: boolean; public readonly systemChannel: TextChannel; public systemChannelID: Snowflake; public verificationLevel: number; public readonly verified: boolean; public readonly voiceConnection: VoiceConnection; - public acknowledge(): Promise; public addMember(user: UserResolvable, options: AddGuildMemberOptions): Promise; - public allowDMs(allow: boolean): Promise; public delete(): Promise; public edit(data: GuildEditData, reason?: string): Promise; public equals(guild: Guild): boolean; @@ -475,7 +395,6 @@ declare module 'discord.js' { public iconURL(options?: AvatarOptions): string; public leave(): Promise; public member(user: UserResolvable): GuildMember; - public search(options?: MessageSearchOptions): Promise; public setAFKChannel(afkChannel: ChannelResolvable, reason?: string): Promise; public setAFKTimeout(afkTimeout: number, reason?: string): Promise; public setChannelPositions(channelPositions: ChannelPosition[]): Promise; @@ -484,13 +403,11 @@ declare module 'discord.js' { public setIcon(icon: Base64Resolvable, reason?: string): Promise; public setName(name: string, reason?: string): Promise; public setOwner(owner: GuildMemberResolvable, reason?: string): Promise; - public setPosition(position: number, relative?: boolean): Promise; public setRegion(region: string, reason?: string): Promise; public setSplash(splash: Base64Resolvable, reason?: string): Promise; public setSystemChannel(systemChannel: ChannelResolvable, reason?: string): Promise; public setVerificationLevel(verificationLevel: number, reason?: string): Promise; public splashURL(options?: AvatarOptions): string; - public sync(): void; public toJSON(): object; public toString(): string; } @@ -534,9 +451,7 @@ declare module 'discord.js' { public readonly calculatedPosition: number; public readonly deletable: boolean; public guild: Guild; - public readonly messageNotifications: GuildChannelMessageNotifications; public readonly manageable: boolean; - public readonly muted: boolean; public name: string; public readonly parent: CategoryChannel; public parentID: Snowflake; @@ -672,7 +587,6 @@ declare module 'discord.js' { public tts: boolean; public type: MessageType; public webhookID: Snowflake; - public acknowledge(): Promise; public awaitReactions(filter: CollectorFilter, options?: AwaitReactionsOptions): Promise>; public createReactionCollector(filter: CollectorFilter, options?: ReactionCollectorOptions): ReactionCollector; public delete(options?: { timeout?: number, reason?: string }): Promise; @@ -1069,7 +983,6 @@ declare module 'discord.js' { public readonly dmChannel: DMChannel; public id: Snowflake; public locale: string; - public readonly note: string; public readonly presence: Presence; public readonly tag: string; public username: string; @@ -1078,8 +991,6 @@ declare module 'discord.js' { public deleteDM(): Promise; public displayAvatarURL(options?: AvatarOptions): string; public equals(user: User): boolean; - public fetchProfile(): Promise; - public setNote(note: string): Promise; public toString(): string; public typingDurationIn(channel: ChannelResolvable): number; public typingIn(channel: ChannelResolvable): boolean; @@ -1097,19 +1008,6 @@ declare module 'discord.js' { public toJSON(): object; } - class UserProfile extends Base { - constructor(user: User, data: object); - private _flags: number; - - public connections: Collection; - public readonly flags: UserFlags[]; - public mutualGuilds: Collection; - public premium: boolean; - public premiumSince: Date; - public user: User; - public toJSON(): object; - } - export class Util { public static basename(path: string, ext?: string): string; public static binaryToID(num: string): Snowflake; @@ -1428,7 +1326,6 @@ declare module 'discord.js' { lastMessageID: Snowflake; lastMessageChannelID: Snowflake; readonly lastMessage: Message; - acknowledge(): Promise; send(content?: StringResolvable, options?: MessageOptions | MessageEmbed | MessageAttachment): Promise; send(options?: MessageOptions | MessageEmbed | MessageAttachment): Promise; }; @@ -1439,7 +1336,6 @@ declare module 'discord.js' { awaitMessages(filter: CollectorFilter, options?: AwaitMessagesOptions): Promise>; bulkDelete(messages: Collection | Message[] | number, filterOld?: boolean): Promise>; createMessageCollector(filter: CollectorFilter, options?: MessageCollectorOptions): MessageCollector; - search(options?: MessageSearchOptions): Promise; startTyping(count?: number): Promise; stopTyping(force?: boolean): void; } & PartialTextBasedChannelFields; @@ -1600,7 +1496,6 @@ declare module 'discord.js' { messageSweepInterval?: number; fetchAllMembers?: boolean; disableEveryone?: boolean; - sync?: boolean; restWsBridgeTimeout?: number; restTimeOffset?: number; disabledEvents?: WSEventType[]; @@ -1793,9 +1688,6 @@ declare module 'discord.js' { reason?: string; }; - type GuildChannelMessageNotifications = MessageNotifications - | 'INHERIT'; - type GuildEditData = { name?: string; region?: string; @@ -1888,10 +1780,6 @@ declare module 'discord.js' { footer?: { text?: string; icon_url?: string; iconURL?: string; }; }; - type MessageNotifications = 'EVERYTHING' - | 'MENTIONS' - | 'NOTHING'; - type MessageOptions = { tts?: boolean; nonce?: string; @@ -1908,60 +1796,6 @@ declare module 'discord.js' { type MessageResolvable = Message | Snowflake; - type MessageSearchOptions = { - content?: string; - maxID?: Snowflake; - minID?: Snowflake; - has?: 'link' - | 'embed' - | 'file' - | 'video' - | 'image' - | 'sound' - | '-link' - | '-embed' - | '-file' - | '-video' - | '-image' - | '-sound'; - channel?: ChannelResolvable; - author?: UserResolvable; - authorType?: 'user' - | 'bot' - | 'webhook' - | '-user' - | '-bot' - | '-webhook'; - sortBy?: 'relevant' | 'timestamp'; - sortOrder?: 'asc' | 'desc'; - contextSize?: number; - limit?: number; - offset?: number; - mentions?: UserResolvable; - mentionsEveryone?: boolean; - linkHostname?: string; - embedProvider?: string; - embedType?: 'image' - | 'video' - | 'url' - | 'rich' - | '-image' - | '-video' - | '-url' - | '-rich'; - attachmentFilename?: string; - attachmentExtension?: string; - before?: Date; - after?: Date; - during?: Date; - nsfw?: boolean; - }; - - type MessageSearchResult = { - total: number; - results: Message[][]; - } - type MessageType = 'DEFAULT' | 'RECIPIENT_ADD' | 'RECIPIENT_REMOVE' @@ -2122,7 +1956,6 @@ declare module 'discord.js' { type WSEventType = 'READY' | 'RESUMED' - | 'GUILD_SYNC' | 'GUILD_CREATE' | 'GUILD_DELETE' | 'GUILD_UPDATE' @@ -2148,15 +1981,10 @@ declare module 'discord.js' { | 'MESSAGE_REACTION_REMOVE' | 'MESSAGE_REACTION_REMOVE_ALL' | 'USER_UPDATE' - | 'USER_NOTE_UPDATE' - | 'USER_SETTINGS_UPDATE' - | 'USER_GUILD_SETTINGS_UPDATE' | 'PRESENCE_UPDATE' | 'VOICE_STATE_UPDATE' | 'TYPING_START' - | 'VOICE_SERVER_UPDATE' - | 'RELATIONSHIP_ADD' - | 'RELATIONSHIP_REMOVE'; + | 'VOICE_SERVER_UPDATE'; //#endregion }