From 18dd59fe42f7a702bae852bd3201433fa3bf8040 Mon Sep 17 00:00:00 2001 From: Nicholas Tay Date: Mon, 28 Mar 2016 19:04:44 +1100 Subject: [PATCH 1/2] Fix bot detection on updateDetails --- lib/Client/InternalClient.js | 2 +- src/Client/InternalClient.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index 23dbfec3f..d8bf118d6 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -1241,7 +1241,7 @@ var InternalClient = (function () { //def updateDetails 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"); + if (!this.user.bot && !(this.email || data.email)) throw new Error("Must provide email since a token was used to login"); var options = { avatar: this.resolver.resolveToBase64(data.avatar) || this.user.avatar, diff --git a/src/Client/InternalClient.js b/src/Client/InternalClient.js index ce2584428..e7e80b596 100644 --- a/src/Client/InternalClient.js +++ b/src/Client/InternalClient.js @@ -1013,7 +1013,7 @@ export default class InternalClient { //def updateDetails updateDetails(data) { - if (!this.bot && !(this.email || data.email)) + if (!this.user.bot && !(this.email || data.email)) throw new Error("Must provide email since a token was used to login"); var options = { From 77346e3415b53c7320b231bc50ad125636ad4d94 Mon Sep 17 00:00:00 2001 From: Nicholas Tay Date: Mon, 28 Mar 2016 19:05:59 +1100 Subject: [PATCH 2/2] Send guild_id on voice destroy for bot accounts to work (thanks qeled for supplying this fix, as per in the node_discord-js discord chat channel :D) --- lib/Voice/VoiceConnection.js | 2 +- src/Voice/VoiceConnection.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Voice/VoiceConnection.js b/lib/Voice/VoiceConnection.js index 684ea65e1..12d2c1c6c 100644 --- a/lib/Voice/VoiceConnection.js +++ b/lib/Voice/VoiceConnection.js @@ -99,7 +99,7 @@ var VoiceConnection = (function (_EventEmitter) { this.client.internal.sendWS({ op: 4, d: { - guild_id: null, + guild_id: this.server.id, channel_id: null, self_mute: true, self_deaf: false diff --git a/src/Voice/VoiceConnection.js b/src/Voice/VoiceConnection.js index 9e43cfdff..daa2c47ad 100644 --- a/src/Voice/VoiceConnection.js +++ b/src/Voice/VoiceConnection.js @@ -62,7 +62,7 @@ export default class VoiceConnection extends EventEmitter { { op : 4, d : { - guild_id : null, + guild_id : this.server.id, channel_id : null, self_mute : true, self_deaf : false