Vencord/src/plugins/apiNotices.ts

26 lines
820 B
TypeScript
Raw Normal View History

2022-10-01 00:27:28 +00:00
import { Devs } from "../utils/constants";
2022-09-30 22:42:50 +00:00
import definePlugin from "../utils/types";
export default definePlugin({
name: "ApiNotices",
description: "Fixes notices being automatically dismissed",
2022-10-01 00:27:28 +00:00
authors: [Devs.Ven],
2022-09-30 22:42:50 +00:00
required: true,
patches: [
{
find: "updateNotice:",
replacement: [
{
match: /;(.{1,2}=null;)(?=.{0,50}updateNotice)/g,
replace:
";if(Vencord.Api.Notices.currentNotice)return !1;$1"
2022-09-30 22:42:50 +00:00
},
{
match: /(?<=NOTICE_DISMISS:function.+?){(?=if\(null==(.+?)\))/,
replace: '{if($1?.id=="VencordNotice")return ($1=null,Vencord.Api.Notices.nextNotice(),true);'
}
]
}
],
});