From abe910d80d2848127e5ee1857cfccedfbdbbbf07 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sat, 23 Aug 2025 02:02:02 +0200 Subject: [PATCH] fix not being able to dismiss Vencord Notices --- src/plugins/_api/notices.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/_api/notices.ts b/src/plugins/_api/notices.ts index 2384a10e..3b43c31a 100644 --- a/src/plugins/_api/notices.ts +++ b/src/plugins/_api/notices.ts @@ -32,9 +32,16 @@ export default definePlugin({ match: /(?<=!1;)\i=null;(?=.{0,80}getPremiumSubscription\(\))/g, replace: "if(Vencord.Api.Notices.currentNotice)return false;$&" }, + + // TODO: remove this compat eventually { match: /(?<=,NOTICE_DISMISS:function\(\i\){)return null!=(\i)/, - replace: (m, notice) => `if(${notice}?.id=="VencordNotice")return(${notice}=null,Vencord.Api.Notices.nextNotice(),true);${m}` + replace: (m, notice) => `if(${notice}?.id=="VencordNotice")return(${notice}=null,Vencord.Api.Notices.nextNotice(),true);${m}`, + noWarn: true, + }, + { + match: /(?<=function (\i)\(\i\){)return null!=(\i)(?=.+?NOTICE_DISMISS:\1)/, + replace: (m, _, notice) => `if(${notice}?.id=="VencordNotice")return(${notice}=null,Vencord.Api.Notices.nextNotice(),true);${m}` } ] }