mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
added updating roles
This commit is contained in:
@@ -75,11 +75,11 @@ class Server {
|
||||
|
||||
getRole(id){
|
||||
for (var role of this.roles) {
|
||||
if (role.id === id) {
|
||||
if (role.id == id) {
|
||||
return role;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -96,15 +96,13 @@ class Server {
|
||||
}
|
||||
|
||||
updateRole(data){
|
||||
|
||||
|
||||
var oldRole = this.getRole(data.id);
|
||||
|
||||
if(oldRole){
|
||||
|
||||
var index = this.roles.indexOf(oldRole);
|
||||
this.roles[index] = new ServerPermissions(data);
|
||||
|
||||
|
||||
return this.roles[index];
|
||||
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user