Vencord / plugin-requests

Vencord plugin requests. Open the link below to create a request
https://github.com/Vencord/plugin-requests/issues/new?template=request.yml
29 stars 2 forks source link

RoleMembers #359

Open fishidiot opened 7 months ago

fishidiot commented 7 months ago

Plugin Description

A mod that allows you to see all members of a certain role on a server.

Existing Plugin for other mod

https://betterdiscord.app/plugin/RoleMembers

Request Agreement

fishidiot commented 7 months ago

you can alr do this in permissions viewer afaik

you can view the permissions of the role but you cant view all the members that actually have that role like the plugin does

distancelol commented 7 months ago

Was about to suggest this. Yes!

Sqaaakoi commented 7 months ago

you can alr do this in permissions viewer afaik

you can view the permissions of the role but you cant view all the members that actually have that role like the plugin does

The stock role menu, NOT the PermissionViewer plugin image of role menu tabs showing members list tab

distancelol commented 7 months ago

you can alr do this in permissions viewer afaik

you can view the permissions of the role but you cant view all the members that actually have that role like the plugin does

The stock role menu, NOT the PermissionViewer plugin image of role menu tabs showing members list tab

As someone with no access to the roles menu, you cant.

Sqaaakoi commented 7 months ago

you can alr do this in permissions viewer afaik

you can view the permissions of the role but you cant view all the members that actually have that role like the plugin does

The stock role menu, NOT the PermissionViewer plugin image of role menu tabs showing members list tab

As someone with no access to the roles menu, you cant.

just did some research this is entirely possible just query /guilds/:guildId/roles/:roleId/member-ids (see Endpoints.GUILD_ROLE_MEMBER_IDS) returns array of user ids

distancelol commented 7 months ago

you can alr do this in permissions viewer afaik

you can view the permissions of the role but you cant view all the members that actually have that role like the plugin does

The stock role menu, NOT the PermissionViewer plugin image of role menu tabs showing members list tab

As someone with no access to the roles menu, you cant.

just did some research this is entirely possible just query /guilds/:guildId/roles/:roleId/member-ids (see Endpoints.GUILD_ROLE_MEMBER_IDS) returns array of user ids

i know its possible, but you cant see it from the default menu is what i meant

y8x7 commented 5 months ago

you can alr do this in permissions viewer afaik

you can view the permissions of the role but you cant view all the members that actually have that role like the plugin does

The stock role menu, NOT the PermissionViewer plugin image of role menu tabs showing members list tab

As someone with no access to the roles menu, you cant.

just did some research this is entirely possible just query /guilds/:guildId/roles/:roleId/member-ids (see Endpoints.GUILD_ROLE_MEMBER_IDS) returns array of user ids

i know its possible, but you cant see it from the default menu is what i meant

You can use this to disable local perms checks which allows you to use stock menu

let _mods; webpackChunkdiscord_app.push([[Symbol()],{},r=>_mods=r.c]);
webpackChunkdiscord_app.pop();

let findByProps = (...props) => {
    for (let m of Object.values(_mods)) {
        try {
            if (!m.exports || m.exports === window) continue;
            if (props.every((x) => m.exports?.[x])) return m.exports;

            for (let ex in m.exports) {
                if (props.every((x) => m.exports?.[ex]?.[x])) return m.exports[ex];
            }
        } catch {}
    }
}

let {IncidentAlertModeratorPermissions} = findByProps("IncidentAlertModeratorPermissions"),
    {MemberSafetyPagePermissions} = findByProps("MemberSafetyPagePermissions"),
    {ElevatedPermissions} = findByProps("ElevatedPermissions");

let permStore = findByProps("canBasicChannel");
["can", "canAccessGuildSettings", "canAccessMemberSafetyPage", "canBasicChannel", "canImpersonateRole", "canManageUser", "canWithPartialContext", "isRoleHigher"]
    .forEach(a => permStore.__proto__[a] = () => true);

let permUtils = findByProps("hasAny", "combine");
permUtils.hasAny = (a, b) => 
    [IncidentAlertModeratorPermissions, MemberSafetyPagePermissions, ElevatedPermissions].includes(b) || Boolean(a | b);
7heMech commented 5 months ago

Since the above doesn't work, this is a "fixed" version:

let _mods; webpackChunkdiscord_app.push([[Symbol()],{},r=>_mods=r.c]);
webpackChunkdiscord_app.pop();

let findByProps = (...props) => {
    for (let m of Object.values(_mods)) {
        try {
            if (!m.exports || m.exports === window) continue;
            if (props.every((x) => m.exports?.[x])) return m.exports;

            for (let ex in m.exports) {
                if (props.every((x) => m.exports?.[ex]?.[x])) return m.exports[ex];
            }
        } catch {}
    }
}

let permStore = findByProps("canBasicChannel");
["can", "canAccessGuildSettings", "canAccessMemberSafetyPage", "canBasicChannel", "canImpersonateRole", "canManageUser", "canWithPartialContext", "isRoleHigher"]
    .forEach(a => permStore.__proto__[a] = () => true);
Limesly commented 4 months ago

Since the above doesn't work, this is a "fixed" version:

how do you use this code, where would I go to input this?

kdoeodkdokdkdkdododiieieie commented 4 months ago

There's an experiment for this.