mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
Refactor OAuth application stuff
This commit is contained in:
@@ -327,13 +327,13 @@ class Client extends EventEmitter {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get's the bot's OAuth2 app.
|
||||
* Gets the bot's OAuth2 application.
|
||||
* <warn>This is only available for bot accounts.</warn>
|
||||
* @returns {Promise<ClientOAuth2App>}
|
||||
*/
|
||||
getMyApp() {
|
||||
fetchApplication() {
|
||||
if (!this.user.bot) throw new Error(Constants.Errors.NO_BOT_ACCOUNT);
|
||||
return this.rest.methods.getMyApp();
|
||||
return this.rest.methods.getMyApplication();
|
||||
}
|
||||
|
||||
setTimeout(fn, ...params) {
|
||||
|
||||
@@ -10,7 +10,7 @@ const Role = requireStructure('Role');
|
||||
const Invite = requireStructure('Invite');
|
||||
const Webhook = requireStructure('Webhook');
|
||||
const UserProfile = requireStructure('UserProfile');
|
||||
const ClientOAuth2App = requireStructure('ClientOAuth2App');
|
||||
const ClientOAuth2Application = requireStructure('ClientOAuth2Application');
|
||||
|
||||
class RESTMethods {
|
||||
constructor(restManager) {
|
||||
@@ -611,9 +611,9 @@ class RESTMethods {
|
||||
return this.rest.makeRequest('get', Constants.Endpoints.messageReaction(channelID, messageID, emoji, limit), true);
|
||||
}
|
||||
|
||||
getMyApp() {
|
||||
return this.rest.makeRequest('get', Constants.Endpoints.myApp, true).then(app =>
|
||||
new ClientOAuth2App(this.rest.client, app)
|
||||
getMyApplication() {
|
||||
return this.rest.makeRequest('get', Constants.Endpoints.myApplication, true).then(app =>
|
||||
new ClientOAuth2Application(this.rest.client, app)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user