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>
This commit is contained in:
parent
1fe7f3c297
commit
393f76749a
1 changed files with 10 additions and 2 deletions
|
@ -47,8 +47,8 @@ const settings = definePluginSettings({
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "USRBG",
|
name: "USRBG",
|
||||||
description: "USRBG is a community maintained database of Discord banners, allowing anyone to get a banner without requiring Nitro",
|
description: "Displays user banners from USRBG, allowing anyone to get a banner without Nitro",
|
||||||
authors: [Devs.AutumnVN, Devs.pylix],
|
authors: [Devs.AutumnVN, Devs.pylix, Devs.TheKodeToad],
|
||||||
settings,
|
settings,
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
|
@ -61,6 +61,10 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
match: /(\i)\.bannerSrc,/,
|
match: /(\i)\.bannerSrc,/,
|
||||||
replace: "$self.useBannerHook($1),"
|
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;
|
if (data[userId]) return 2;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
shouldShowBadge({ displayProfile, user }: any) {
|
||||||
|
return displayProfile?.banner && (!data[user.id] || settings.store.nitroFirst);
|
||||||
|
},
|
||||||
|
|
||||||
async start() {
|
async start() {
|
||||||
enableStyle(style);
|
enableStyle(style);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue