From 870528ed33b22b7a803915965da9f701cf62ccd2 Mon Sep 17 00:00:00 2001 From: izexi <43889168+izexi@users.noreply.github.com> Date: Mon, 29 Apr 2019 17:35:48 +0100 Subject: [PATCH] feat(VoiceChannel): add editable (#3173) * add VoiceChannel#editable * replace unnecessary super with this Co-Authored-By: izexi <43889168+izexi@users.noreply.github.com> --- src/structures/VoiceChannel.js | 9 +++++++++ typings/index.d.ts | 1 + 2 files changed, 10 insertions(+) diff --git a/src/structures/VoiceChannel.js b/src/structures/VoiceChannel.js index 8b49715fd91a..860241e9c9b9 100644 --- a/src/structures/VoiceChannel.js +++ b/src/structures/VoiceChannel.js @@ -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} diff --git a/typings/index.d.ts b/typings/index.d.ts index 99b0962e00a8..dd117d172ca4 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -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;