mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-14 09:03:03 -04:00
PronounDB: Rework API to avoid rate limits
This commit is contained in:
parent
db5fe2a394
commit
b1db18c319
6 changed files with 208 additions and 205 deletions
|
@ -21,9 +21,9 @@ import "./styles.css";
|
|||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
|
||||
import { useProfilePronouns } from "./api";
|
||||
import PronounsAboutComponent from "./components/PronounsAboutComponent";
|
||||
import { CompactPronounsChatComponentWrapper, PronounsChatComponentWrapper } from "./components/PronounsChatComponent";
|
||||
import { useProfilePronouns } from "./pronoundbUtils";
|
||||
import { settings } from "./settings";
|
||||
|
||||
export default definePlugin({
|
||||
|
@ -53,15 +53,15 @@ export default definePlugin({
|
|||
replacement: [
|
||||
{
|
||||
match: /\.PANEL},/,
|
||||
replace: "$&[vcPronoun,vcPronounSource,vcHasPendingPronouns]=$self.useProfilePronouns(arguments[0].user?.id),"
|
||||
replace: "$&{pronouns:vcPronoun,source:vcPronounSource,hasPendingPronouns:vcHasPendingPronouns}=$self.useProfilePronouns(arguments[0].user?.id),"
|
||||
},
|
||||
{
|
||||
match: /text:\i\.\i.Messages.USER_PROFILE_PRONOUNS/,
|
||||
replace: '$&+(vcHasPendingPronouns?"":` (${vcPronounSource})`)'
|
||||
replace: '$&+(vcPronoun==null||vcHasPendingPronouns?"":` (${vcPronounSource})`)'
|
||||
},
|
||||
{
|
||||
match: /(\.pronounsText.+?children:)(\i)/,
|
||||
replace: "$1vcHasPendingPronouns?$2:vcPronoun"
|
||||
replace: "$1(vcPronoun==null||vcHasPendingPronouns)?$2:vcPronoun"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue