mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 05:23:31 +01:00
Check if user or bot and require email for user
This commit is contained in:
@@ -1219,6 +1219,8 @@ var InternalClient = (function () {
|
|||||||
//def updateDetails
|
//def updateDetails
|
||||||
|
|
||||||
InternalClient.prototype.updateDetails = function updateDetails(data) {
|
InternalClient.prototype.updateDetails = function updateDetails(data) {
|
||||||
|
if (!this.bot && !(this.email || data.email)) throw new Error("Must provide email since a token was used to login");
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
avatar: this.resolver.resolveToBase64(data.avatar) || this.user.avatar,
|
avatar: this.resolver.resolveToBase64(data.avatar) || this.user.avatar,
|
||||||
username: data.username || this.user.username
|
username: data.username || this.user.username
|
||||||
|
|||||||
@@ -1005,6 +1005,9 @@ export default class InternalClient {
|
|||||||
|
|
||||||
//def updateDetails
|
//def updateDetails
|
||||||
updateDetails(data) {
|
updateDetails(data) {
|
||||||
|
if (!this.bot && !(this.email || data.email))
|
||||||
|
throw new Error("Must provide email since a token was used to login");
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
avatar: this.resolver.resolveToBase64(data.avatar) || this.user.avatar,
|
avatar: this.resolver.resolveToBase64(data.avatar) || this.user.avatar,
|
||||||
username: data.username || this.user.username
|
username: data.username || this.user.username
|
||||||
|
|||||||
Reference in New Issue
Block a user