mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Added ability to use updateDetails() with token
This commit is contained in:
@@ -1220,7 +1220,10 @@ var InternalClient = (function () {
|
||||
|
||||
InternalClient.prototype.updateDetails = function updateDetails(data) {
|
||||
if (!this.email && !data.email) {
|
||||
throw new Error("Can't use updateDetails because only a token has been used for login!");
|
||||
return this.apiRequest("patch", _Constants.Endpoints.ME, true, {
|
||||
avatar: this.resolver.resolveToBase64(data.avatar) || this.user.avatar,
|
||||
username: data.username || this.user.username
|
||||
});
|
||||
}
|
||||
return this.apiRequest("patch", _Constants.Endpoints.ME, true, {
|
||||
avatar: this.resolver.resolveToBase64(data.avatar) || this.user.avatar,
|
||||
|
||||
@@ -1006,7 +1006,10 @@ export default class InternalClient {
|
||||
//def updateDetails
|
||||
updateDetails(data) {
|
||||
if (!this.email && !data.email) {
|
||||
throw new Error("Can't use updateDetails because only a token has been used for login!");
|
||||
return this.apiRequest("patch", Endpoints.ME, true, {
|
||||
avatar: this.resolver.resolveToBase64(data.avatar) || this.user.avatar,
|
||||
username: data.username || this.user.username
|
||||
});
|
||||
}
|
||||
return this.apiRequest("patch", Endpoints.ME, true, {
|
||||
avatar: this.resolver.resolveToBase64(data.avatar) || this.user.avatar,
|
||||
|
||||
Reference in New Issue
Block a user