Add VoiceChannel.joinable/speakable (#802)

* add some getters to voice channels

* Update VoiceChannel.js

* Update VoiceChannel.js

* Update VoiceChannel.js
This commit is contained in:
Gus Caplan
2016-10-14 17:58:48 -05:00
committed by Schuyler Cebulskie
parent 8f0e2e0c56
commit 50a1d1cbef
2 changed files with 17 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -45,6 +45,22 @@ class VoiceChannel extends GuildChannel {
return null;
}
/**
* Checks if the client has permission join the voice channel
* @type {boolean}
*/
get joinable() {
return this.permissionsFor(this.client.user).hasPermission('CONNECT');
}
/**
* Checks if the client has permission to send audio to the voice channel
* @type {boolean}
*/
get speakable() {
return this.permissionsFor(this.client.user).hasPermission('SPEAK');
}
/**
* Sets the bitrate of the channel
* @param {number} bitrate The new bitrate