From 2ee8ea5c1ed6cb78750f328040ff684a8084e03f Mon Sep 17 00:00:00 2001 From: newt Date: Sun, 17 Nov 2024 12:21:16 +0000 Subject: [PATCH] basic one-way sync --- index.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 index.ts diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..3cbe96a --- /dev/null +++ b/index.ts @@ -0,0 +1,22 @@ +import definePlugin from "@utils/types"; +import { FluxDispatcher } from "@webpack/common"; + +export default definePlugin({ + name: "muter", + description: "muter companion plugin. Mirrors system mutes to Discord.", + authors: [{ name: "isitreallyalive", id: 1269669249056510026n }], + start() { + const socket = new WebSocket("ws://localhost:3034"); + + socket.onmessage = (event) => { + let mute = event.data.size > 0; + FluxDispatcher.dispatch({ + type: "AUDIO_SET_SELF_MUTE", + context: "default", + mute + }); + }; + + // todo: try to fix weird virtual bug + } +}); \ No newline at end of file