mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
Added role creation and new role listening
bot.createRole(server, cb(err, ServerPermissions))
and
bot.on("serverRoleCreate", server, ServerPermissions)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user