diff options
author | fawn <fawn@envs.net> | 2023-02-10 21:41:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-10 22:41:49 +0100 |
commit | d95be1acbaa282c53508a33d85cdda2ea76c50da (patch) | |
tree | 48145b1ff9c4455956d48c8b3c840323167fa96e | |
parent | 1d995e58f515dbeb908ba34bf70f829bfd3ccfac (diff) | |
download | Vencord-d95be1acbaa282c53508a33d85cdda2ea76c50da.tar.gz Vencord-d95be1acbaa282c53508a33d85cdda2ea76c50da.tar.bz2 Vencord-d95be1acbaa282c53508a33d85cdda2ea76c50da.zip |
refactor: update plugins to use `$self` (#478)
Co-authored-by: Ven <vendicated@riseup.net>
-rw-r--r-- | src/plugins/anonymiseFileNames.ts | 2 | ||||
-rw-r--r-- | src/plugins/betterGifAltText.ts | 4 | ||||
-rw-r--r-- | src/plugins/betterRoleDot.ts | 2 | ||||
-rw-r--r-- | src/plugins/callTimer.tsx | 2 | ||||
-rw-r--r-- | src/plugins/emoteCloner.tsx | 2 | ||||
-rw-r--r-- | src/plugins/forceOwnerCrown.ts | 2 | ||||
-rw-r--r-- | src/plugins/ignoreActivities.tsx | 6 | ||||
-rw-r--r-- | src/plugins/loadingQuotes.ts | 2 | ||||
-rw-r--r-- | src/plugins/memberCount.tsx | 2 | ||||
-rw-r--r-- | src/plugins/messageLogger/index.tsx | 8 | ||||
-rw-r--r-- | src/plugins/noBlockedMessages.ts | 2 | ||||
-rw-r--r-- | src/plugins/noReplyMention.tsx | 2 | ||||
-rw-r--r-- | src/plugins/pronoundb/index.ts | 4 | ||||
-rw-r--r-- | src/plugins/reviewDB/index.tsx | 2 | ||||
-rw-r--r-- | src/plugins/spotifyControls/index.tsx | 2 | ||||
-rw-r--r-- | src/plugins/startupTimings/index.tsx | 2 | ||||
-rw-r--r-- | src/plugins/vcDoubleClick.ts | 2 | ||||
-rw-r--r-- | src/plugins/viewIcons.tsx | 2 | ||||
-rw-r--r-- | src/plugins/whoReacted.tsx | 2 |
19 files changed, 26 insertions, 26 deletions
diff --git a/src/plugins/anonymiseFileNames.ts b/src/plugins/anonymiseFileNames.ts index f953a14..26c423c 100644 --- a/src/plugins/anonymiseFileNames.ts +++ b/src/plugins/anonymiseFileNames.ts @@ -36,7 +36,7 @@ export default definePlugin({ replacement: { match: /uploadFiles:(.{1,2}),/, replace: - "uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=Vencord.Plugins.plugins.AnonymiseFileNames.anonymise(f.filename)),$1(...args)),", + "uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=$self.anonymise(f.filename)),$1(...args)),", }, }, ], diff --git a/src/plugins/betterGifAltText.ts b/src/plugins/betterGifAltText.ts index 686ef0a..5e0191b 100644 --- a/src/plugins/betterGifAltText.ts +++ b/src/plugins/betterGifAltText.ts @@ -31,7 +31,7 @@ export default definePlugin({ replacement: { match: /(return.{0,10}\.jsx.{0,50}isWindowFocused)/, replace: - "Vencord.Plugins.plugins.BetterGifAltText.altify(e);$1", + "$self.altify(e);$1", }, }, { @@ -39,7 +39,7 @@ export default definePlugin({ replacement: { match: /(?<==(.{1,3})\.alt.{0,20})\?.{0,5}\.Messages\.GIF/, replace: - "?($1.alt='GIF',Vencord.Plugins.plugins.BetterGifAltText.altify($1))", + "?($1.alt='GIF',$self.altify($1))", }, }, ], diff --git a/src/plugins/betterRoleDot.ts b/src/plugins/betterRoleDot.ts index 6cadf79..6ef92a8 100644 --- a/src/plugins/betterRoleDot.ts +++ b/src/plugins/betterRoleDot.ts @@ -33,7 +33,7 @@ export default definePlugin({ find: "M0 4C0 1.79086 1.79086 0 4 0H16C18.2091 0 20 1.79086 20 4V16C20 18.2091 18.2091 20 16 20H4C1.79086 20 0 18.2091 0 16V4Z", replacement: { match: /viewBox:"0 0 20 20"/, - replace: "$&,onClick:()=>Vencord.Plugins.plugins.BetterRoleDot.copyToClipBoard(e.color),style:{cursor:'pointer'}", + replace: "$&,onClick:()=>$self.copyToClipBoard(e.color),style:{cursor:'pointer'}", }, }, { diff --git a/src/plugins/callTimer.tsx b/src/plugins/callTimer.tsx index ff02256..f745bf6 100644 --- a/src/plugins/callTimer.tsx +++ b/src/plugins/callTimer.tsx @@ -75,7 +75,7 @@ export default definePlugin({ find: ".renderConnectionStatus=", replacement: { match: /(?<=renderConnectionStatus=.+\.channel,children:)\w/, - replace: "[$&, Vencord.Plugins.plugins.CallTimer.renderTimer(this.props.channel.id)]" + replace: "[$&, $self.renderTimer(this.props.channel.id)]" } }], renderTimer(channelId: string) { diff --git a/src/plugins/emoteCloner.tsx b/src/plugins/emoteCloner.tsx index bb74406..15d1358 100644 --- a/src/plugins/emoteCloner.tsx +++ b/src/plugins/emoteCloner.tsx @@ -187,7 +187,7 @@ export default definePlugin({ find: "open-native-link", replacement: { match: /id:"open-native-link".{0,200}\(\{href:(.{0,3}),.{0,200}\},"open-native-link"\)/, - replace: "$&,Vencord.Plugins.plugins.EmoteCloner.makeMenu(arguments[2])" + replace: "$&,$self.makeMenu(arguments[2])" }, }, diff --git a/src/plugins/forceOwnerCrown.ts b/src/plugins/forceOwnerCrown.ts index 0c1df47..3122410 100644 --- a/src/plugins/forceOwnerCrown.ts +++ b/src/plugins/forceOwnerCrown.ts @@ -30,7 +30,7 @@ export default definePlugin({ find: ".renderOwner=", replacement: { match: /isOwner;return null!=(\w+)?&&/g, - replace: "isOwner;if(Vencord.Plugins.plugins.ForceOwnerCrown.isGuildOwner(this.props)){$1=true;}return null!=$1&&" + replace: "isOwner;if($self.isGuildOwner(this.props)){$1=true;}return null!=$1&&" } }, ], diff --git a/src/plugins/ignoreActivities.tsx b/src/plugins/ignoreActivities.tsx index 300caf7..56a0a8d 100644 --- a/src/plugins/ignoreActivities.tsx +++ b/src/plugins/ignoreActivities.tsx @@ -146,19 +146,19 @@ export default definePlugin({ find: ".Messages.SETTINGS_GAMES_TOGGLE_OVERLAY", replacement: { match: /var .=(?<props>.)\.overlay.+?"aria-label":.\..\.Messages\.SETTINGS_GAMES_TOGGLE_OVERLAY.+?}}\)/, - replace: "$&,Vencord.Plugins.plugins.IgnoreActivities.renderToggleGameActivityButton($<props>)" + replace: "$&,$self.renderToggleGameActivityButton($<props>)" } }, { find: ".overlayBadge", replacement: { match: /.badgeContainer.+?.\?\(0,.\.jsx\)\(.{1,2},{name:(?<props>.)\.name}\):null/, - replace: "$&,Vencord.Plugins.plugins.IgnoreActivities.renderToggleActivityButton($<props>)" + replace: "$&,$self.renderToggleActivityButton($<props>)" } }, { find: '.displayName="LocalActivityStore"', replacement: { match: /(?<activities>.)\.push\(.\({type:.\..{1,3}\.LISTENING.+?\)\)/, - replace: "$&;$<activities>=$<activities>.filter(Vencord.Plugins.plugins.IgnoreActivities.isActivityNotIgnored);" + replace: "$&;$<activities>=$<activities>.filter($self.isActivityNotIgnored);" } }], diff --git a/src/plugins/loadingQuotes.ts b/src/plugins/loadingQuotes.ts index 052bfe6..7be6f30 100644 --- a/src/plugins/loadingQuotes.ts +++ b/src/plugins/loadingQuotes.ts @@ -68,7 +68,7 @@ export default definePlugin({ find: ".LOADING_DID_YOU_KNOW", replacement: { match: /\._loadingText=.+?random\(.+?;/s, - replace: "._loadingText=Vencord.Plugins.plugins.LoadingQuotes.quote;", + replace: "._loadingText=$self.quote;", }, }, ], diff --git a/src/plugins/memberCount.tsx b/src/plugins/memberCount.tsx index 947d4d7..e17157e 100644 --- a/src/plugins/memberCount.tsx +++ b/src/plugins/memberCount.tsx @@ -99,7 +99,7 @@ export default definePlugin({ find: ".isSidebarVisible,", replacement: { match: /(var (.)=.\.className.+?children):\[(.\.useMemo[^}]+"aria-multiselectable")/, - replace: "$1:[$2.startsWith('members')?Vencord.Plugins.plugins.MemberCount.render():null,$3" + replace: "$1:[$2.startsWith('members')?$self.render():null,$3" } }], diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index ff4c328..9242ce2 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -151,7 +151,7 @@ export default definePlugin({ replace: "MESSAGE_DELETE:function($1){" + " var cache = $2getOrCreate($1.channelId);" + - " cache = Vencord.Plugins.plugins.MessageLogger.handleDelete(cache, $1, false);" + + " cache = $self.handleDelete(cache, $1, false);" + " $2commit(cache);" + "}," }, @@ -161,7 +161,7 @@ export default definePlugin({ replace: "MESSAGE_DELETE_BULK:function($1){" + " var cache = $2getOrCreate($1.channelId);" + - " cache = Vencord.Plugins.plugins.MessageLogger.handleDelete(cache, $1, true);" + + " cache = $self.handleDelete(cache, $1, true);" + " $2commit(cache);" + "}," }, @@ -171,7 +171,7 @@ export default definePlugin({ replace: "$1" + ".update($3,m =>" + " $2.message.content !== m.editHistory?.[0]?.content && $2.message.content !== m.content ?" + - " m.set('editHistory',[...(m.editHistory || []), Vencord.Plugins.plugins.MessageLogger.makeEdit($2.message, m)]) :" + + " m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($2.message, m)]) :" + " m" + ")" + ".update($3" @@ -287,7 +287,7 @@ export default definePlugin({ { // Render editHistory in the deepest div for message content match: /(\)\("div",\{id:.+?children:\[)/, - replace: "$1 (arguments[0].message.editHistory.length > 0 ? arguments[0].message.editHistory.map(edit => Vencord.Plugins.plugins.MessageLogger.renderEdit(edit)) : null), " + replace: "$1 (arguments[0].message.editHistory.length > 0 ? arguments[0].message.editHistory.map(edit => $self.renderEdit(edit)) : null), " } ] }, diff --git a/src/plugins/noBlockedMessages.ts b/src/plugins/noBlockedMessages.ts index bd72ce5..6937041 100644 --- a/src/plugins/noBlockedMessages.ts +++ b/src/plugins/noBlockedMessages.ts @@ -43,7 +43,7 @@ export default definePlugin({ replacement: [ { match: /(?<=MESSAGE_CREATE:function\((\w)\){var \w=\w\.channelId,\w=\w\.message,\w=\w\.isPushNotification,\w=\w\.\w\.getOrCreate\(\w\));/, - replace: ";if(Vencord.Plugins.plugins.NoBlockedMessages.isBlocked(n))return;" + replace: ";if($self.isBlocked(n))return;" } ] } diff --git a/src/plugins/noReplyMention.tsx b/src/plugins/noReplyMention.tsx index 91a88d3..2e97588 100644 --- a/src/plugins/noReplyMention.tsx +++ b/src/plugins/noReplyMention.tsx @@ -51,7 +51,7 @@ export default definePlugin({ replacement: { match: /CREATE_PENDING_REPLY:function\((.{1,2})\){/, replace: - "CREATE_PENDING_REPLY:function($1){$1.shouldMention=Vencord.Plugins.plugins.NoReplyMention.shouldMention($1);", + "CREATE_PENDING_REPLY:function($1){$1.shouldMention=$self.shouldMention($1);", }, }, ], diff --git a/src/plugins/pronoundb/index.ts b/src/plugins/pronoundb/index.ts index c848110..7ebe919 100644 --- a/src/plugins/pronoundb/index.ts +++ b/src/plugins/pronoundb/index.ts @@ -38,7 +38,7 @@ export default definePlugin({ find: "showCommunicationDisabledStyles", replacement: { match: /(?<=return\s*\(0,\w{1,3}\.jsxs?\)\(.+!\w{1,3}&&)(\(0,\w{1,3}.jsxs?\)\(.+?\{.+?\}\))/, - replace: "[$1, Vencord.Plugins.plugins.PronounDB.PronounsChatComponent(e)]" + replace: "[$1, $self.PronounsChatComponent(e)]" } }, // Hijack the discord pronouns section (hidden without experiment) and add a wrapper around the text section @@ -46,7 +46,7 @@ export default definePlugin({ find: ".Messages.BOT_PROFILE_SLASH_COMMANDS", replacement: { match: /\(0,.\.jsx\)\((?<PronounComponent>.{1,2}\..),(?<pronounProps>{currentPronouns.+?:(?<fullProps>.{1,2})\.pronouns.+?})\)/, - replace: "$<fullProps>&&Vencord.Plugins.plugins.PronounDB.PronounsProfileWrapper($<PronounComponent>,$<pronounProps>,$<fullProps>)" + replace: "$<fullProps>&&$self.PronounsProfileWrapper($<PronounComponent>,$<pronounProps>,$<fullProps>)" } }, // Make pronouns experiment be enabled by default diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx index 744c2d6..8e83983 100644 --- a/src/plugins/reviewDB/index.tsx +++ b/src/plugins/reviewDB/index.tsx @@ -37,7 +37,7 @@ export default definePlugin({ find: "disableBorderColor:!0", replacement: { match: /\(.{0,10}\{user:(.),setNote:.,canDM:.,.+?\}\)/, - replace: "$&,Vencord.Plugins.plugins.ReviewDB.getReviewsComponent($1)" + replace: "$&,$self.getReviewsComponent($1)" }, } ], diff --git a/src/plugins/spotifyControls/index.tsx b/src/plugins/spotifyControls/index.tsx index 86e187e..5d82998 100644 --- a/src/plugins/spotifyControls/index.tsx +++ b/src/plugins/spotifyControls/index.tsx @@ -55,7 +55,7 @@ export default definePlugin({ // return React.createElement(AccountPanel, { ..., showTaglessAccountPanel: blah }) match: /return ?(.{0,30}\(.{1,3},\{[^}]+?,showTaglessAccountPanel:.+?\}\))/, // return [Player, Panel] - replace: "return [Vencord.Plugins.plugins.SpotifyControls.renderPlayer(),$1]" + replace: "return [$self.renderPlayer(),$1]" } }, // Adds POST and a Marker to the SpotifyAPI (so we can easily find it) diff --git a/src/plugins/startupTimings/index.tsx b/src/plugins/startupTimings/index.tsx index 2ab00a6..5d66f5f 100644 --- a/src/plugins/startupTimings/index.tsx +++ b/src/plugins/startupTimings/index.tsx @@ -29,7 +29,7 @@ export default definePlugin({ find: "PAYMENT_FLOW_MODAL_TEST_PAGE,", replacement: { match: /{section:.{1,2}\..{1,3}\.PAYMENT_FLOW_MODAL_TEST_PAGE/, - replace: '{section:"StartupTimings",label:"Startup Timings",element:Vencord.Plugins.plugins.StartupTimings.StartupTimingPage},$&' + replace: '{section:"StartupTimings",label:"Startup Timings",element:$self.StartupTimingPage},$&' } }], StartupTimingPage: LazyComponent(() => require("./StartupTimingPage").default) diff --git a/src/plugins/vcDoubleClick.ts b/src/plugins/vcDoubleClick.ts index 1985107..39b8a05 100644 --- a/src/plugins/vcDoubleClick.ts +++ b/src/plugins/vcDoubleClick.ts @@ -42,7 +42,7 @@ export default definePlugin({ // voice/stage channels { match: /onClick:function\(\)\{(e\.handleClick.+?)}/g, - replace: "onClick:function(){Vencord.Plugins.plugins.VoiceChatDoubleClick.schedule(()=>{$1},e)}", + replace: "onClick:function(){$self.schedule(()=>{$1},e)}", }, ], }, diff --git a/src/plugins/viewIcons.tsx b/src/plugins/viewIcons.tsx index 307fd01..26f2902 100644 --- a/src/plugins/viewIcons.tsx +++ b/src/plugins/viewIcons.tsx @@ -79,7 +79,7 @@ export default new class ViewIcons implements PluginDef { }, { match: /(id:"leave-guild".{0,200}),(\(0,.{1,3}\.jsxs?\).{0,200}function)/, - replace: "$1,Vencord.Plugins.plugins.ViewIcons.buildGuildContextMenuEntries(_guild),$2" + replace: "$1,$self.buildGuildContextMenuEntries(_guild),$2" } ] } diff --git a/src/plugins/whoReacted.tsx b/src/plugins/whoReacted.tsx index 685d954..a14ca3a 100644 --- a/src/plugins/whoReacted.tsx +++ b/src/plugins/whoReacted.tsx @@ -92,7 +92,7 @@ export default definePlugin({ find: ",reactionRef:", replacement: { match: /((.)=(.{1,3})\.hideCount)(,.+?reactionCount.+?\}\))/, - replace: "$1,whoReactedProps=$3$4,$2?null:Vencord.Plugins.plugins.WhoReacted.renderUsers(whoReactedProps)" + replace: "$1,whoReactedProps=$3$4,$2?null:$self.renderUsers(whoReactedProps)" } }], |