mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 22:51:32 +00:00
Added ability to use updateDetails() with token
This commit is contained in:
parent
204bdca555
commit
4386daf7a0
2 changed files with 8 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue