Added role creation and new role listening

bot.createRole(server, cb(err, ServerPermissions))

and

bot.on("serverRoleCreate", server, ServerPermissions)
This commit is contained in:
hydrabolt
2015-10-26 12:06:38 +00:00
parent e3d2181914
commit 0f02856a8c
9 changed files with 189 additions and 4 deletions

View File

@@ -94,6 +94,17 @@ var Server = (function () {
return null;
};
Server.prototype.addRole = function addRole(data) {
if (this.getRole(data.id)) {
return this.getRole(data.id);
}
var perms = new ServerPermissions(data);
this.roles.push(perms);
return perms;
};
Server.prototype.updateRole = function updateRole(data) {
var oldRole = this.getRole(data.id);