Add role mentioning (#385)

* Add role mentioning

* Add to docs

* Forgot to save again
This commit is contained in:
Manuel Kraus
2016-05-29 05:46:16 +02:00
committed by abalabahaha
parent 95e3e3e3dc
commit b4dcd657cf
3 changed files with 25 additions and 1 deletions

View File

@@ -166,6 +166,15 @@ var Role = (function () {
return this.client.removeUserFromRole.apply(this.client, [member, this, callback]);
};
Role.prototype.mention = function mention() {
if (this.mentionable) return "<@&" + this.id + ">";
return this.name;
};
Role.prototype.toString = function toString() {
return this.mention();
};
return Role;
})();