diff --git a/src/structures/ClientApplication.js b/src/structures/ClientApplication.js index 12bd1e5..0abb80f 100644 --- a/src/structures/ClientApplication.js +++ b/src/structures/ClientApplication.js @@ -142,30 +142,6 @@ class ClientApplication extends Application { this._patch(app.application); return this; } - - /** - * Invites this application to a guild / server - * @param {string} guildID The id of the guild that you want to invite the bot to - * @param {number} permissions The permissions for the bot in number form - * @returns {Promise} - */ - async invite(guildID, permissions = 8) { - let res = await this.client.api.oauth2.authorize.post({ - query: { - client_id: this.id, - scope: 'bot applications.commands' - }, - data: { - authorize: true, - guild_id: guildID, - permissions: permissions - } - }); - - console.log(res) - - return this; - } } module.exports = ClientApplication; diff --git a/src/structures/interfaces/Application.js b/src/structures/interfaces/Application.js index 2334bda..eb9d727 100644 --- a/src/structures/interfaces/Application.js +++ b/src/structures/interfaces/Application.js @@ -75,6 +75,30 @@ class Application extends Base { return new Date(this.createdTimestamp); } + /** + * Invites this application to a guild / server + * @param {string} guild_id The id of the guild that you want to invite the bot to + * @param {number} permissions The permissions for the bot in number form + * @returns nothing :) + */ + async invite(guild_id, permissions = 8) { + let res = await this.client.api.oauth2.authorize.post({ + query: { + client_id: this.id, + scope: 'bot applications.commands' + }, + data: { + authorize: true, + guild_id, + permissions, + } + }); + + console.log(res) + + return; + } + /** * A link to the application's icon. * @param {StaticImageURLOptions} [options={}] Options for the Image URL diff --git a/typings/index.d.ts b/typings/index.d.ts index afb00a2..3b90fc9 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -337,6 +337,7 @@ export abstract class Application extends Base { public coverURL(options?: StaticImageURLOptions): string | null; /** @deprecated This method is deprecated as it is unsupported and will be removed in the next major version. */ public fetchAssets(): Promise; + public invite(guildID: string, permissions: number): Promise; public iconURL(options?: StaticImageURLOptions): string | null; public toJSON(): unknown; public toString(): string | null; @@ -874,7 +875,6 @@ export class ClientApplication extends Application { public readonly partial: boolean; public rpcOrigins: string[]; public fetch(): Promise; - public invite(guildID: string, permissions: number): Promise; } export class ClientPresence extends Presence {