-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] UserMessagesPronouns
loading of pronouns
#2967
Comments
this is kinda difficult to do because pronouns are only available in the profile payload, which you can only fetch by opening someones profile you have to fetch it individually for every user and the rate limit isn't very generous thus, fetching everyone in chat is likely not viable |
I've already dumped some thoughts about this days ago
the only realistic way of solving this (excluding spamming the API) is making a cache in DataStore, which isn't hard to do i'd suggest having each user in the cache expire after not being used for amount of time |
Fixes Vendicated#2967 Implement a caching mechanism for pronouns to load them without the need to click on the user's profile. * **Caching Mechanism**: - Implement caching using `DataStore` in `src/plugins/userMessagesPronouns/utils.ts`. - Add functions to get, set, and fetch pronouns with caching. - Modify `useDiscordPronouns` to check the cache before fetching pronouns. - Export `fetchAndCachePronouns` function. * **PronounsChatComponent**: - Update `PronounsChatComponent` in `src/plugins/userMessagesPronouns/PronounsChatComponent.tsx` to use cached pronouns if available. * **Message Events**: - Add logic in `src/plugins/userMessagesPronouns/index.ts` to fetch and cache pronouns when a user sends a message. - Add export for `MessageEvents` in `src/api/MessageEvents.ts`.
is vancord better than better discord? |
Discord Account
mylloon
What happens when the bug or crash occurs?
The pronouns are only loaded when clicking on the profile
What is the expected behaviour?
I expect pronouns to be loaded without the need of a click
How do you recreate this bug or crash?
Errors
No response
Request Agreement
The text was updated successfully, but these errors were encountered: