mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
renamed OAuth2Application#reset to resetSecret and added resetToken (#1541)
This commit is contained in:
@@ -408,7 +408,7 @@ class Client extends EventEmitter {
|
|||||||
* @returns {Promise<OAuth2Application>}
|
* @returns {Promise<OAuth2Application>}
|
||||||
*/
|
*/
|
||||||
fetchApplication(id = '@me') {
|
fetchApplication(id = '@me') {
|
||||||
return this.rest.api.oauth2.applications(id).get()
|
return this.api.oauth2.applications(id).get()
|
||||||
.then(app => new OAuth2Application(this, app));
|
.then(app => new OAuth2Application(this, app));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const paramable = [
|
|||||||
'bans', 'emojis', 'pins', 'permissions',
|
'bans', 'emojis', 'pins', 'permissions',
|
||||||
'reactions', 'webhooks', 'messages',
|
'reactions', 'webhooks', 'messages',
|
||||||
'notes', 'roles', 'applications',
|
'notes', 'roles', 'applications',
|
||||||
'invites',
|
'invites', 'bot',
|
||||||
];
|
];
|
||||||
const reflectors = ['toString', 'valueOf', 'inspect', Symbol.toPrimitive, util.inspect.custom];
|
const reflectors = ['toString', 'valueOf', 'inspect', Symbol.toPrimitive, util.inspect.custom];
|
||||||
|
|
||||||
|
|||||||
@@ -133,14 +133,25 @@ class OAuth2Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset the app's secret and bot token.
|
* Reset the app's secret.
|
||||||
|
* <warn>This is only available when using a user account.</warn>
|
||||||
* @returns {OAuth2Application}
|
* @returns {OAuth2Application}
|
||||||
*/
|
*/
|
||||||
reset() {
|
resetSecret() {
|
||||||
return this.rest.api.oauth2.applications(this.id).reset.post()
|
return this.client.api.oauth2.applications(this.id).reset.post()
|
||||||
.then(app => new OAuth2Application(this.client, app));
|
.then(app => new OAuth2Application(this.client, app));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset the app's bot token.
|
||||||
|
* <warn>This is only available when using a user account.</warn>
|
||||||
|
* @returns {OAuth2Application}
|
||||||
|
*/
|
||||||
|
resetToken() {
|
||||||
|
return this.client.api.oauth2.applications(this.id).bot().reset.post()
|
||||||
|
.then(app => new OAuth2Application(this.client, Object.assign({}, this, { bot: app })));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When concatenated with a string, this automatically concatenates the app name rather than the app object.
|
* When concatenated with a string, this automatically concatenates the app name rather than the app object.
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
|
|||||||
Reference in New Issue
Block a user