diff --git a/src/index.js b/src/index.js index 49854f49ff..402045bd92 100644 --- a/src/index.js +++ b/src/index.js @@ -52,6 +52,10 @@ module.exports = { * @external DiscordJSConfig * @see {@link https://discord.js.org/#/docs/main/master/typedef/ClientOptions} */ +/** + * @external ClientApplication + * @see {@link https://discord.js.org/#/docs/main/master/class/ClientApplication} + */ /** * @external Collection * @see {@link https://discord.js.org/#/docs/main/master/class/Collection} diff --git a/src/lib/Client.js b/src/lib/Client.js index 201070d2e9..8ae992c539 100644 --- a/src/lib/Client.js +++ b/src/lib/Client.js @@ -253,7 +253,7 @@ class KlasaClient extends Discord.Client { /** * The application info cached from the discord api * @since 0.0.1 - * @type {object} + * @type {external:ClientApplication} */ this.application = null; diff --git a/typings/index.d.ts b/typings/index.d.ts index 0822bbea77..b9d96fa95f 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -2,6 +2,7 @@ declare module 'klasa' { import { Client, + ClientApplication, ClientOptions, Collection, Snowflake, @@ -23,14 +24,11 @@ declare module 'klasa' { VoiceChannel as DiscordVoiceChannel, DMChannel as DiscordDMChannel, GroupDMChannel as DiscordGroupDMChannel, - OAuth2Application, MessageOptions, ReactionCollector, StringResolvable, - Attachment, - RichEmbed, - RichEmbedOptions, + MessageAttachment, BufferResolvable } from 'discord.js'; @@ -66,7 +64,7 @@ declare module 'klasa' { util: Util; }; public settings: StringMappedType>; - public application: OAuth2Application; + public application: ClientApplication; public readonly invite: string; public readonly owner: ExtendedUser; @@ -201,9 +199,9 @@ declare module 'klasa' { } export class RichDisplay { - public constructor(embed: RichEmbed); - public embedTemplate: RichEmbed; - public pages: RichEmbed[]; + public constructor(embed: MessageEmbed); + public embedTemplate: MessageEmbed; + public pages: MessageEmbed[]; public infoPage?: MessageEmbed; public emojis: RichDisplayEmojisObject; public footered: boolean; @@ -213,20 +211,20 @@ declare module 'klasa' { public setInfoPage(embed: MessageEmbed): RichDisplay; public run(msg: ExtendedMessage, options?: RichDisplayRunOptions): Promise; private _footer(): void; - private _determineEmojis(emojis: emoji[], stop: boolean): emoji[]; - private _handlePageGeneration(cb: Function|RichEmbed): RichEmbed; + protected _determineEmojis(emojis: emoji[], stop: boolean, jump: boolean, firstLast: boolean): emoji[]; + private _handlePageGeneration(cb: Function|MessageEmbed): MessageEmbed; } export class RichMenu extends RichDisplay { - public constructor(embed: RichEmbed); + public constructor(embed: MessageEmbed); public emojis: RichMenuEmojisObject; public paginated: boolean; public options: MenuOption[]; public addOption(name: string, body: string, inline?: boolean): RichMenu; - public run(msg: ExtendedMessage, options?: RichMenuRunOptions): ReactionHandler; + public run(msg: ExtendedMessage, options?: RichMenuRunOptions): Promise; - private _determineEmojis(emojis: emoji[], stop: boolean, jump: boolean, firstLast: boolean): emoji[]; + protected _determineEmojis(emojis: emoji[], stop: boolean): emoji[]; private _paginate(): void; } @@ -1268,7 +1266,7 @@ declare module 'klasa' { send(content?: StringResolvable, options?: MessageOptions): Promise; send(options: MessageOptions): Promise; sendCode(lang: string, content: StringResolvable, options?: MessageOptions): Promise; - sendEmbed(embed: RichEmbed | RichEmbedOptions, content?: string, options?: MessageOptions): Promise; + sendEmbed(embed: MessageEmbed, content?: string, options?: MessageOptions): Promise; sendMessage(content?: string, options?: MessageOptions): Promise; } & DiscordMessage; @@ -1281,10 +1279,10 @@ declare module 'klasa' { send(content?: StringResolvable, options?: MessageOptions): Promise; send(options: MessageOptions): Promise; sendCode(lang: string, content: StringResolvable, options?: MessageOptions): Promise; - sendEmbed(embed: RichEmbed | RichEmbedOptions, content?: string, options?: MessageOptions): Promise; - sendEmbed(embed: RichEmbed | RichEmbedOptions, options?: MessageOptions): Promise; + sendEmbed(embed: MessageEmbed, content?: string, options?: MessageOptions): Promise; + sendEmbed(embed: MessageEmbed, options?: MessageOptions): Promise; sendFile(attachment: BufferResolvable, name?: string, content?: StringResolvable, options?: MessageOptions): Promise; - sendFiles(attachments: Attachment[], content: StringResolvable, options?: MessageOptions): Promise; + sendFiles(attachments: MessageAttachment[], content: StringResolvable, options?: MessageOptions): Promise; sendMessage(content?: string, options?: MessageOptions): Promise; sendMessage(options: MessageOptions): Promise; } & DiscordUser; @@ -1297,10 +1295,10 @@ declare module 'klasa' { send(content?: StringResolvable, options?: MessageOptions): Promise; send(options: MessageOptions): Promise; sendCode(lang: string, content: StringResolvable, options?: MessageOptions): Promise; - sendEmbed(embed: RichEmbed | RichEmbedOptions, content?: string, options?: MessageOptions): Promise; - sendEmbed(embed: RichEmbed | RichEmbedOptions, options?: MessageOptions): Promise; + sendEmbed(embed: MessageEmbed, content?: string, options?: MessageOptions): Promise; + sendEmbed(embed: MessageEmbed, options?: MessageOptions): Promise; sendFile(attachment: BufferResolvable, name?: string, content?: StringResolvable, options?: MessageOptions): Promise; - sendFiles(attachments: Attachment[], content: StringResolvable, options?: MessageOptions): Promise; + sendFiles(attachments: MessageAttachment[], content: StringResolvable, options?: MessageOptions): Promise; sendMessage(content?: string, options?: MessageOptions): Promise; sendMessage(options: MessageOptions): Promise; } & DiscordTextChannel; @@ -1316,10 +1314,10 @@ declare module 'klasa' { send(content?: StringResolvable, options?: MessageOptions): Promise; send(options: MessageOptions): Promise; sendCode(lang: string, content: StringResolvable, options?: MessageOptions): Promise; - sendEmbed(embed: RichEmbed | RichEmbedOptions, content?: string, options?: MessageOptions): Promise; - sendEmbed(embed: RichEmbed | RichEmbedOptions, options?: MessageOptions): Promise; + sendEmbed(embed: MessageEmbed, content?: string, options?: MessageOptions): Promise; + sendEmbed(embed: MessageEmbed, options?: MessageOptions): Promise; sendFile(attachment: BufferResolvable, name?: string, content?: StringResolvable, options?: MessageOptions): Promise; - sendFiles(attachments: Attachment[], content: StringResolvable, options?: MessageOptions): Promise; + sendFiles(attachments: MessageAttachment[], content: StringResolvable, options?: MessageOptions): Promise; sendMessage(content?: string, options?: MessageOptions): Promise; sendMessage(options: MessageOptions): Promise; } & DiscordDMChannel; @@ -1331,10 +1329,10 @@ declare module 'klasa' { send(content?: StringResolvable, options?: MessageOptions): Promise; send(options: MessageOptions): Promise; sendCode(lang: string, content: StringResolvable, options?: MessageOptions): Promise; - sendEmbed(embed: RichEmbed | RichEmbedOptions, content?: string, options?: MessageOptions): Promise; - sendEmbed(embed: RichEmbed | RichEmbedOptions, options?: MessageOptions): Promise; + sendEmbed(embed: MessageEmbed, content?: string, options?: MessageOptions): Promise; + sendEmbed(embed: MessageEmbed, options?: MessageOptions): Promise; sendFile(attachment: BufferResolvable, name?: string, content?: StringResolvable, options?: MessageOptions): Promise; - sendFiles(attachments: Attachment[], content: StringResolvable, options?: MessageOptions): Promise; + sendFiles(attachments: MessageAttachment[], content: StringResolvable, options?: MessageOptions): Promise; sendMessage(content?: string, options?: MessageOptions): Promise; sendMessage(options: MessageOptions): Promise; } & DiscordGroupDMChannel;