feat(VoiceChannel): add editable (#3173)

* add VoiceChannel#editable

* replace unnecessary super with this

Co-Authored-By: izexi <43889168+izexi@users.noreply.github.com>
This commit is contained in:
izexi
2019-04-29 17:35:48 +01:00
committed by Amish Shah
parent 23191da13d
commit 870528ed33
2 changed files with 10 additions and 0 deletions

View File

@@ -71,6 +71,15 @@ class VoiceChannel extends GuildChannel {
return super.deletable && this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT, false);
}
/**
* Whether the channel is editable by the client user
* @type {boolean}
* @readonly
*/
get editable() {
return this.manageable && this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT, false);
}
/**
* Whether the channel is joinable by the client user
* @type {boolean}

1
typings/index.d.ts vendored
View File

@@ -1148,6 +1148,7 @@ declare module 'discord.js' {
constructor(guild: Guild, data?: object);
public bitrate: number;
public readonly connection: VoiceConnection;
public readonly editable: boolean;
public readonly full: boolean;
public readonly joinable: boolean;
public readonly members: Collection<Snowflake, GuildMember>;