diff options
Diffstat (limited to 'src/plugins/apiNotices.ts')
-rw-r--r-- | src/plugins/apiNotices.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/apiNotices.ts b/src/plugins/apiNotices.ts new file mode 100644 index 0000000..d58ac4b --- /dev/null +++ b/src/plugins/apiNotices.ts @@ -0,0 +1,24 @@ +import definePlugin from "../utils/types"; + +export default definePlugin({ + name: "ApiNotices", + description: "Fixes notices being automatically dismissed", + author: "Vendicated", + required: true, + patches: [ + { + find: "updateNotice:", + replacement: [ + { + match: /;(.{1,2}=null;)(?=.{0,50}updateNotice)/g, + replace: + ';if(Vencord.Api.Notices.currentNotice)return !1;$1' + }, + { + match: /(?<=NOTICE_DISMISS:function.+?){(?=if\(null==(.+?)\))/, + replace: '{if($1?.id=="VencordNotice")return ($1=null,Vencord.Api.Notices.nextNotice(),true);' + } + ] + } + ], +}); |