Skip to content

Commit

Permalink
feat(VoiceChannel): add editable (#3173)
Browse files Browse the repository at this point in the history
* add VoiceChannel#editable

* replace unnecessary super with this

Co-Authored-By: izexi <[email protected]>
  • Loading branch information
izexi authored and amishshah committed Apr 29, 2019
1 parent 23191da commit 870528e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/structures/VoiceChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 1 addition & 0 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down

0 comments on commit 870528e

Please sign in to comment.