memberHasRole, membersWithRole

This commit is contained in:
abalabahaha
2016-01-29 17:02:40 -08:00
parent 2c8747995a
commit ee2172c1d5
8 changed files with 83 additions and 58 deletions

View File

@@ -187,6 +187,10 @@ var Server = (function (_Equality) {
}
};
Server.prototype.rolesOfMember = function rolesOfMember(member) {
return this.rolesOfUser(member);
};
Server.prototype.rolesOf = function rolesOf(user) {
return this.rolesOfUser(user);
};
@@ -322,6 +326,16 @@ var Server = (function (_Equality) {
return this.client.createChannel.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
};
Server.prototype.membersWithRole = function membersWithRole(role) {
return this.members.filter(function (m) {
return m.hasRole(role);
});
};
Server.prototype.usersWithRole = function usersWithRole(role) {
return this.membersWithRole(role);
};
_createClass(Server, [{
key: "iconURL",
get: function get() {