Discord-Oxygen / Discord-Console-hacks

A collection of JavaScript Codes I've made to enhance the User Experience of Discord and some other Discord related stuff
GNU General Public License v3.0
521 stars 114 forks source link

Hidden channels #46

Closed FarisBlayz closed 2 years ago

FarisBlayz commented 2 years ago

Hello, The hidden channel script example is an image, Please can you give me the script since I can't copy the script off an image, Thanks.

FarisBlayz commented 2 years ago

I figured it out lol you can close the issue,

FarisBlayz commented 2 years ago

By the way what can you do with these ID's? Like is it possible to view them or what exactly can you do with the private hidden channel discord ID's?

hxr404 commented 2 years ago

By the way what can you do with these ID's? Like is it possible to view them or what exactly can you do with the private hidden channel discord ID's?

Well for example you could get the Name of the channels or view who can access them / who has which perms, you won't be able to access the channels contents. Questions like these might be better suited in the discord server, invite is on the readme.

Since your original question is resolved I'll close this now.

ghost commented 2 years ago

somewhat irrelevant, but hxr's snippet actually displays dms rather than hidden channels

if you want hidden channels, you can roughly compare getMutableGuildChannelsForGuild("GUILD") and getChannels("GUILD")

the snippet below shows how to get the hidden channels (Channel objects, not ids)

function getHiddenChannelIds(guildID) { // guildID should be type "string", btw
    let mod;
    let visibleChannels = [];
    let hiddenChannels = [];
    window.webpackChunkdiscord_app.push([[Math.random()],{},(e)=>{mod=mod||Object.values(e.c).find(m=>m?.exports?.default&&m.exports.default["getMutableGuildChannelsForGuild"])}]);
    let allChannels = Object.keys(mod.exports.default.getMutableGuildChannelsForGuild(guildID));
    mod = undefined;
    window.webpackChunkdiscord_app.push([[Math.random()],{},(e)=>{mod=mod||Object.values(e.c).find(m=>m?.exports?.default&&m.exports.default["getChannels"])}]);
    mod.exports.default.getChannels(guildID)["SELECTABLE"].forEach(o => visibleChannels.push(o.channel.id));
    mod = undefined;
    window.webpackChunkdiscord_app.push([[Math.random()],{},(e)=>{mod=mod||Object.values(e.c).find(m=>m?.exports?.default&&m.exports.default["hasChannel"])}]);
    allChannels.filter(hiddenChannel => visibleChannels.every(visibleChannel => visibleChannel != hiddenChannel)).forEach(channelId => hiddenChannels.push(mod.exports.default.getChannel(channelId))); // takes visible channels away from all channels, leaving us with non-visible ("hidden") channels
    mod = undefined;
    return hiddenChannels.filter(channelObj => channelObj.isCategory() == false); // makes sure no categories are falsely flagged as hidden channels
}

note that some parts (window.webpackChunkdiscord_app.pushes, mainly) have been minified so the function doesnt seem even bigger than it already is