Update EditRoles.plugin.js

This commit is contained in:
Mirco Wittrien 2021-07-01 17:09:59 +02:00
parent a6d4e9e55d
commit 98eec11d45
1 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* @name EditRoles * @name EditRoles
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.0.4 * @version 1.0.5
* @description Allows you to locally edit Roles * @description Allows you to locally edit Roles
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,12 +17,12 @@ module.exports = (_ => {
"info": { "info": {
"name": "EditRoles", "name": "EditRoles",
"author": "DevilBro", "author": "DevilBro",
"version": "1.0.4", "version": "1.0.5",
"description": "Allows you to locally edit Roles" "description": "Allows you to locally edit Roles"
}, },
"changeLog": { "changeLog": {
"fixed": { "fixed": {
"Role Names": "Fixed issue where the role name was changed to the role color string and not the name" "Colorless Names": "Fixed issue where changing the name of a role without changing the color, would result in usernames to become colorless"
} }
} }
}; };
@ -96,7 +96,7 @@ module.exports = (_ => {
let role; let role;
for (let id of e.returnValue.roles) if (guild.roles[id] && guild.roles[id].colorString && (!role || role.position < guild.roles[id].position)) role = guild.roles[id]; for (let id of e.returnValue.roles) if (guild.roles[id] && guild.roles[id].colorString && (!role || role.position < guild.roles[id].position)) role = guild.roles[id];
let data = role && changedRoles[role.id]; let data = role && changedRoles[role.id];
if (data) e.returnValue = Object.assign({}, e.returnValue, {colorString: data.color ? BDFDB.ColorUtils.convert(data.color, "HEX") : null}); if (data) e.returnValue = Object.assign({}, e.returnValue, {colorString: data.color ? BDFDB.ColorUtils.convert(data.color, "HEX") : e.returnValue.colorString});
} }
} }
}}); }});