Add Role.members

This commit is contained in:
Schuyler Cebulskie
2016-09-20 23:27:56 -04:00
parent aa9fdf2e26
commit 46c28c0d05

View File

@@ -85,6 +85,14 @@ class Role {
return `#${col}`;
}
/**
* The cached guild members that have this role.
* @type {Collection<string, GuildMember>}
*/
get members() {
return this.guild.members.filter(m => m.roles.has(this.id));
}
/**
* Get an object mapping permission names to whether or not the role enables that permission
* @returns {Object<string, boolean>}