mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
Fixed colours
This commit is contained in:
@@ -71,7 +71,7 @@ var Server = (function () {
|
||||
|
||||
// get/set
|
||||
|
||||
Server.prototype.getRole = function getRole(id) {
|
||||
Server.prototype.getRole = function getRole(key, value) {
|
||||
for (var _iterator3 = this.roles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
|
||||
var _ref3;
|
||||
|
||||
@@ -86,7 +86,7 @@ var Server = (function () {
|
||||
|
||||
var role = _ref3;
|
||||
|
||||
if (role.id == id) {
|
||||
if (role[key] === value) {
|
||||
return role;
|
||||
}
|
||||
}
|
||||
@@ -96,18 +96,18 @@ var Server = (function () {
|
||||
|
||||
Server.prototype.addRole = function addRole(data) {
|
||||
|
||||
if (this.getRole(data.id)) {
|
||||
return this.getRole(data.id);
|
||||
if (this.getRole("id", data.id)) {
|
||||
return this.getRole("id", data.id);
|
||||
}
|
||||
|
||||
var perms = new ServerPermissions(data);
|
||||
var perms = new ServerPermissions(data, this);
|
||||
this.roles.push(perms);
|
||||
return perms;
|
||||
};
|
||||
|
||||
Server.prototype.updateRole = function updateRole(data) {
|
||||
|
||||
var oldRole = this.getRole(data.id);
|
||||
var oldRole = this.getRole("id", data.id);
|
||||
|
||||
if (oldRole) {
|
||||
var index = this.roles.indexOf(oldRole);
|
||||
|
||||
Reference in New Issue
Block a user