From 46c28c0d05153da4dd27b4ff7c6cafacc852217e Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Tue, 20 Sep 2016 23:27:56 -0400 Subject: [PATCH] Add Role.members --- src/structures/Role.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/structures/Role.js b/src/structures/Role.js index 0195a7d61..90ec74fec 100644 --- a/src/structures/Role.js +++ b/src/structures/Role.js @@ -85,6 +85,14 @@ class Role { return `#${col}`; } + /** + * The cached guild members that have this role. + * @type {Collection} + */ + 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}