fix: NoticesAPI (#1863)

This commit is contained in:
redstonekasi 2023-10-25 17:19:53 +02:00 committed by V
parent cf3c28e1ff
commit 8d1561aed4

@ -29,12 +29,12 @@ export default definePlugin({
find: 'displayName="NoticeStore"', find: 'displayName="NoticeStore"',
replacement: [ replacement: [
{ {
match: /(?=;\i=null;.{0,70}getPremiumSubscription)/g, match: /\i=null;(?=.{0,80}getPremiumSubscription\(\))/g,
replace: ";if(Vencord.Api.Notices.currentNotice)return false" replace: "if(Vencord.Api.Notices.currentNotice)return false;$&"
}, },
{ {
match: /(?<=,NOTICE_DISMISS:function\(\i\){)(?=if\(null==(\i)\))/, match: /(?<=,NOTICE_DISMISS:function\(\i\){)return null!=(\i)/,
replace: (_, notice) => `if(${notice}.id=="VencordNotice")return(${notice}=null,Vencord.Api.Notices.nextNotice(),true);` replace: "if($1.id==\"VencordNotice\")return($1=null,Vencord.Api.Notices.nextNotice(),true);$&"
} }
] ]
} }