aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-01 00:42:50 +0200
committerVendicated <vendicated@riseup.net>2022-10-01 00:42:50 +0200
commit8161a07dba401f04dac93f861e6b2cffe53ab7e3 (patch)
tree1499e825bcd6a162bc43507f492b262e9b1901ed /src/plugins
parent9aaa47ea4e9ac068bf5fcbb997e31d722f43f1e5 (diff)
downloadVencord-8161a07dba401f04dac93f861e6b2cffe53ab7e3.tar.gz
Vencord-8161a07dba401f04dac93f861e6b2cffe53ab7e3.tar.bz2
Vencord-8161a07dba401f04dac93f861e6b2cffe53ab7e3.zip
Add in client updater, Notices API
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/apiNotices.ts24
-rw-r--r--src/plugins/clickableRoleDot.ts2
-rw-r--r--src/plugins/index.ts2
3 files changed, 26 insertions, 2 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);'
+ }
+ ]
+ }
+ ],
+});
diff --git a/src/plugins/clickableRoleDot.ts b/src/plugins/clickableRoleDot.ts
index 63ad84e..800a742 100644
--- a/src/plugins/clickableRoleDot.ts
+++ b/src/plugins/clickableRoleDot.ts
@@ -17,7 +17,7 @@ export default definePlugin({
],
copyToClipBoard(color: string) {
- DiscordNative.clipboard.copy(color);
+ window.DiscordNative.clipboard.copy(color);
Toasts.show({
message: "Copied to Clipboard!",
type: Toasts.Type.SUCCESS,
diff --git a/src/plugins/index.ts b/src/plugins/index.ts
index 1490656..e4d0775 100644
--- a/src/plugins/index.ts
+++ b/src/plugins/index.ts
@@ -16,7 +16,7 @@ for (const plugin of Object.values(Plugins)) if (plugin.patches && Settings.plug
}
}
-export function startAll() {
+export function startAllPlugins() {
for (const plugin in Plugins) if (Settings.plugins[plugin].enabled) {
startPlugin(Plugins[plugin]);
}