Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] ShowHiddenThings ModView #2708

Open
2 tasks done
ColynOrg opened this issue Jul 19, 2024 · 3 comments
Open
2 tasks done

[Bug] ShowHiddenThings ModView #2708

ColynOrg opened this issue Jul 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ColynOrg
Copy link

Discord Account

CJStylesOrg

What happens when the bug or crash occurs?

the roles will not show up on the mod view at all despite the user having a role shown in their profile. i have tested this on Bread (304260051915374603) whom is a plugin developer in BetterDiscord. cases like this are rare but i managed to stumble upon this.
Preview

What is the expected behaviour?

i expect the plugin to retrieve the users role and display them in the mod view, im unaware if this is related to discord or the plugin itself.

How do you recreate this bug or crash?

  1. press the mod view button on peoples profile until you notice the roles don't show up on the mod view despite them actually having roles.

Errors

GET https://canary.discord.com/api/v9/guilds/86004744966914048/audit-logs?limit=50&target_id=304260051915374603 403 (Forbidden)
A._end @ web.5654e7cdcca52e5b08a1.js:12
A.end @ web.5654e7cdcca52e5b08a1.js:12
(anonymous) @ web.5654e7cdcca52e5b08a1.js:12
l.then @ web.5654e7cdcca52e5b08a1.js:12
E @ web.5654e7cdcca52e5b08a1.js:12
(anonymous) @ web.5654e7cdcca52e5b08a1.js:12
I @ web.5654e7cdcca52e5b08a1.js:12
t @ e70441093a3116eaa948.js:1
a @ e70441093a3116eaa948.js:1
S @ e70441093a3116eaa948.js:1
e @ c7f4b1b26af37e6d391f.js:1
(anonymous) @ c7f4b1b26af37e6d391f.js:1
sF @ web.5654e7cdcca52e5b08a1.js:12
oV @ web.5654e7cdcca52e5b08a1.js:12
oD @ web.5654e7cdcca52e5b08a1.js:12
r5 @ web.5654e7cdcca52e5b08a1.js:12
(anonymous) @ web.5654e7cdcca52e5b08a1.js:12
oF @ web.5654e7cdcca52e5b08a1.js:12
oO @ web.5654e7cdcca52e5b08a1.js:12
N @ web.5654e7cdcca52e5b08a1.js:12
L @ web.5654e7cdcca52e5b08a1.js:12
T.C.<computed> @ web.5654e7cdcca52e5b08a1.js:1
D @ web.5654e7cdcca52e5b08a1.js:1
b @ web.5654e7cdcca52e5b08a1.js:1

Request Agreement

  • I am using Discord Stable or tried on Stable and this bug happens there as well
  • I have read the requirements for opening an issue above
@ColynOrg ColynOrg added the bug Something isn't working label Jul 19, 2024
@Sqaaakoi

This comment was marked as off-topic.

@Sqaaakoi
Copy link
Contributor

Sqaaakoi commented Jul 19, 2024

nvm i'm wrong. This is a stock Discord issue that we can fix (and need to fix). Discord is using MemberSafetyStore.getEnhancedMember(guildId, userId) to get the highest role, and opening Mod View from the context menu does not try to load that information. Viewing the Members page does load the required data, as that's where Mod View was originally invoked from. Permissions are required to load that data, so we need to patch this anyway. See attached annotated screenshot for what needs to be changed to fix this.

Diagram showing to remove MemberSafetyStore.getEnhancedMember and related get role call and to just find the highest role from the member's (passed to the component) role list and look it up in the same object like the listing of all other roles

EDIT: you can just do s[t.highestRoleId]
EDIT 2: fixed explanation of bug for fix PR that links to this comment

@Sqaaakoi
Copy link
Contributor

tl;dr: discord overcomplicated things and depends on stuff that isnt important at all here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants