This commit is contained in:
Mirco Wittrien 2021-02-04 19:07:37 +01:00
parent dbf4d4c2b5
commit 9e57414527
2 changed files with 9 additions and 5 deletions

View File

@ -7854,7 +7854,7 @@ module.exports = (_ => {
if (m.default && (typeof m.default == "object" || typeof m.default == "function")) for (let j in m.default) if (m.default[j] && typeof m.default[j] == "function" && window.t.$filter(m.default[j])) window.t[j + "_module_" + i + "_default"] = {string: m.default[j].toString(), func: m.default[j], module: m};
}
}
for (let i in BDFDB.DevUtils.req.m) if (typeof BDFDB.DevUtils.req.m[i] == "function" && window.t.$filter(BDFDB.DevUtils.req.m[i])) window.t["funtion_" + i] = {string: BDFDB.DevUtils.req.m[i].toString(), func: BDFDB.DevUtils.req.m[i]};
for (let i in BDFDB.DevUtils.req.m) if (typeof BDFDB.DevUtils.req.m[i] == "function" && window.t.$filter(BDFDB.DevUtils.req.m[i])) window.t["function_" + i] = {string: BDFDB.DevUtils.req.m[i].toString(), func: BDFDB.DevUtils.req.m[i]};
console.clear();
console.log(window.t);
};

View File

@ -14,12 +14,12 @@ module.exports = (_ => {
"info": {
"name": "ShowHiddenChannels",
"author": "DevilBro",
"version": "2.9.1",
"version": "2.9.2",
"description": "Display channels that are hidden from you by role restrictions"
},
"changeLog": {
"fixed": {
"Multiplication Spam": "Fixed issue that occured ifa hidden channel was deleted in a server (often occured with ticket system bots)"
"Canary": "Fixed for Channel Store changes on Canary"
}
}
};
@ -231,7 +231,7 @@ module.exports = (_ => {
}});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.GuildChannelStore, "getTextChannelNameDisambiguations", {after: e => {
let all = BDFDB.LibraryModules.ChannelStore.getGuildChannels();
let all = this.getAllChannels();
for (let channel_id in all) if (all[channel_id].guild_id == e.methodArguments[0] && !e.returnValue[channel_id] && (all[channel_id].type != BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY && all[channel_id].type != BDFDB.DiscordConstants.ChannelTypes.GUILD_VOICE)) e.returnValue[channel_id] = {id: channel_id, name: all[channel_id].name};
}});
@ -461,11 +461,15 @@ module.exports = (_ => {
return channel && hiddenChannelCache[channel.guild_id] && hiddenChannelCache[channel.guild_id].hidden[channel.type] && hiddenChannelCache[channel.guild_id].hidden[channel.type].find(c => c.id == channel.id);
}
getAllChannels () {
return (BDFDB.LibraryModules.ChannelStore.getGuildChannels || BDFDB.LibraryModules.ChannelStore.getMutableGuildChannels || (_ => {return {};}))();
}
getHiddenChannels (guild) {
if (!guild) return [{}, 0];
let hiddenChannels = {}, rolesAmount = (BDFDB.LibraryModules.MemberStore.getMember(guild.id, BDFDB.UserUtils.me.id) || {roles: []}).roles.length;
if (!hiddenChannelCache[guild.id] || hiddenChannelCache[guild.id].roles != rolesAmount) {
let all = BDFDB.LibraryModules.ChannelStore.getGuildChannels();
let all = this.getAllChannels();
for (let type in BDFDB.DiscordConstants.ChannelTypes) hiddenChannels[BDFDB.DiscordConstants.ChannelTypes[type]] = [];
for (let channel_id in all) {
let channel = all[channel_id];