GuildChannel.permissionsFor(role) (#2254)

* GuildChannel.permissionsFor(role)

* 1Comp's requested changes
This commit is contained in:
bdistin
2018-01-18 02:28:14 -06:00
committed by Isabella
parent d5b0cf9ffb
commit b846cbd2b3
3 changed files with 69 additions and 26 deletions

View File

@@ -295,9 +295,9 @@ class GuildMember extends Base {
* @returns {?Permissions}
*/
permissionsIn(channel) {
channel = this.client.channels.resolve(channel);
if (!channel || !channel.guild) throw new Error('GUILD_CHANNEL_RESOLVE');
return channel.permissionsFor(this);
channel = this.guild.channels.resolve(channel);
if (!channel) throw new Error('GUILD_CHANNEL_RESOLVE');
return channel.memberPermissions(this);
}
/**