aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKode <TheKodeToad@proton.me>2023-05-11 18:33:08 +0100
committerGitHub <noreply@github.com>2023-05-11 19:33:08 +0200
commit393f76749a77998497466b284414f15ac9ad4135 (patch)
tree3bd6f81a9f429a217faf79cb5a675b05738ea6ba
parent1fe7f3c297aa3af594c500e5068eea4c2d4cc19b (diff)
downloadVencord-393f76749a77998497466b284414f15ac9ad4135.tar.gz
Vencord-393f76749a77998497466b284414f15ac9ad4135.tar.bz2
Vencord-393f76749a77998497466b284414f15ac9ad4135.zip
USRBG: Hide Nitro badge if banner's source is USRBG (#1096)
* Hide Nitro badge if banner's source is USRBG, tweaks to description * Rename function * Update src/plugins/usrbg/index.tsx --------- Co-authored-by: V <vendicated@riseup.net>
-rw-r--r--src/plugins/usrbg/index.tsx12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/usrbg/index.tsx b/src/plugins/usrbg/index.tsx
index cdb7260..0121d10 100644
--- a/src/plugins/usrbg/index.tsx
+++ b/src/plugins/usrbg/index.tsx
@@ -47,8 +47,8 @@ const settings = definePluginSettings({
export default definePlugin({
name: "USRBG",
- description: "USRBG is a community maintained database of Discord banners, allowing anyone to get a banner without requiring Nitro",
- authors: [Devs.AutumnVN, Devs.pylix],
+ description: "Displays user banners from USRBG, allowing anyone to get a banner without Nitro",
+ authors: [Devs.AutumnVN, Devs.pylix, Devs.TheKodeToad],
settings,
patches: [
{
@@ -61,6 +61,10 @@ export default definePlugin({
{
match: /(\i)\.bannerSrc,/,
replace: "$self.useBannerHook($1),"
+ },
+ {
+ match: /\?\(0,\i\.jsx\)\(\i,{type:\i,shown/,
+ replace: "&&$self.shouldShowBadge(arguments[0])$&"
}
]
},
@@ -104,6 +108,10 @@ export default definePlugin({
if (data[userId]) return 2;
},
+ shouldShowBadge({ displayProfile, user }: any) {
+ return displayProfile?.banner && (!data[user.id] || settings.store.nitroFirst);
+ },
+
async start() {
enableStyle(style);