update
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @name EditRoles
|
||||
* @author DevilBro
|
||||
* @authorId 278543574059057154
|
||||
* @version 1.1.4
|
||||
* @version 1.1.7
|
||||
* @description Allows you to locally edit Roles
|
||||
* @invite Jx3TjNS
|
||||
* @donate https://www.paypal.me/MircoWittrien
|
||||
@@ -91,8 +91,8 @@ module.exports = (_ => {
|
||||
if (guild) {
|
||||
let colorRole, iconRole;
|
||||
for (let id of e.returnValue.roles) {
|
||||
if (guild.roles[id] && guild.roles[id].colorString && (!colorRole || colorRole.position < guild.roles[id].position)) colorRole = guild.roles[id];
|
||||
if (guild.roles[id] && guild.roles[id].icon && (!iconRole || iconRole.position < guild.roles[id].position)) iconRole = guild.roles[id];
|
||||
if (guild.roles[id] && (guild.roles[id].colorString || changedRoles[id] && changedRoles[id].color) && (!colorRole || colorRole.position < guild.roles[id].position)) colorRole = guild.roles[id];
|
||||
if (guild.roles[id] && (guild.roles[id].icon || changedRoles[id] && changedRoles[id].icon) && (!iconRole || iconRole.position < guild.roles[id].position)) iconRole = guild.roles[id];
|
||||
}
|
||||
let color = colorRole && changedRoles[colorRole.id] && changedRoles[colorRole.id].color;
|
||||
if (color) e.returnValue = Object.assign({}, e.returnValue, {colorString: BDFDB.ColorUtils.convert(color, "HEX")});
|
||||
@@ -177,6 +177,7 @@ module.exports = (_ => {
|
||||
}
|
||||
|
||||
onDeveloperContextMenu (e) {
|
||||
if (e.instance.props.label != BDFDB.LanguageUtils.LanguageStrings.COPY_ID_ROLE) return;
|
||||
let guild = this.getGuildFromRoleId(e.instance.props.id);
|
||||
if (guild) e.returnvalue.props.children = [
|
||||
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
|
||||
@@ -225,7 +226,7 @@ module.exports = (_ => {
|
||||
processRichRoleMention (e) {
|
||||
if (!e.instance.props.id || !changedRoles[e.instance.props.id]) return;
|
||||
e.returnvalue.props.color = changedRoles[e.instance.props.id].color ? BDFDB.ColorUtils.convert(changedRoles[e.instance.props.id].color, "int") : e.returnvalue.props.color;
|
||||
e.returnvalue.props.children[1] = changedRoles[e.instance.props.id].name || e.returnvalue.props.children[1];
|
||||
e.returnvalue.props.children[2] = changedRoles[e.instance.props.id].name || e.returnvalue.props.children[1];
|
||||
}
|
||||
|
||||
processAutocompleteRoleResult (e) {
|
||||
@@ -260,7 +261,7 @@ module.exports = (_ => {
|
||||
}
|
||||
|
||||
getGuildFromRoleId (roleId) {
|
||||
return BDFDB.LibraryModules.SortedGuildUtils.getFlattenedGuilds().find(g => g.roles[roleId]);
|
||||
return BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuildIds().map(BDFDB.LibraryStores.GuildStore.getGuild).find(g => g.roles[roleId]);
|
||||
}
|
||||
|
||||
changeRolesInGuild (guild, useNative) {
|
||||
@@ -289,7 +290,7 @@ module.exports = (_ => {
|
||||
BDFDB.DataUtils.remove(this, "roles", id);
|
||||
}
|
||||
else {
|
||||
for (let guild of BDFDB.LibraryModules.SortedGuildUtils.getFlattenedGuilds()) if (cachedRoles[guild.id]) guild.roles = cachedRoles[guild.id];
|
||||
for (let guild of BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuildIds().map(BDFDB.LibraryStores.GuildStore.getGuild)) if (cachedRoles[guild.id]) guild.roles = cachedRoles[guild.id];
|
||||
cachedRoles = {};
|
||||
BDFDB.DataUtils.remove(this, "roles");
|
||||
}
|
||||
@@ -417,6 +418,11 @@ module.exports = (_ => {
|
||||
callback("");
|
||||
BDFDB.ReactUtils.forceUpdate(instance);
|
||||
}
|
||||
else if (url.indexOf("data:") == 0) {
|
||||
instance.props.success = true;
|
||||
delete instance.props.errorMessage;
|
||||
callback(url);
|
||||
}
|
||||
else instance.checkTimeout = BDFDB.TimeUtils.timeout(_ => {
|
||||
BDFDB.LibraryRequires.request(url, {agentOptions: {rejectUnauthorized: false}}, (error, response, result) => {
|
||||
delete instance.checkTimeout;
|
||||
@@ -474,10 +480,10 @@ module.exports = (_ => {
|
||||
return {
|
||||
confirm_reset: "Είστε βέβαιοι ότι θέλετε να επαναφέρετε αυτόν τον ρόλο;",
|
||||
confirm_resetall: "Είστε βέβαιοι ότι θέλετε να επαναφέρετε όλους τους ρόλους;",
|
||||
context_localrolesettings: "Ρυθμίσεις τοπικού ρόλου",
|
||||
modal_header: "Ρυθμίσεις τοπικού ρόλου",
|
||||
context_localrolesettings: "Ρυθμίσεις ρόλου {τοπικά)",
|
||||
modal_header: "Ρυθμίσεις ρόλου (τοπικά)",
|
||||
submenu_resetsettings: "Επαναφορά ρόλου",
|
||||
submenu_rolesettings: "Αλλαξε ρυθμίσεις"
|
||||
submenu_rolesettings: "Αλλαγή ρυθμίσεων"
|
||||
};
|
||||
case "es": // Spanish
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user