commit 2ee8ea5c1ed6cb78750f328040ff684a8084e03f Author: newt Date: Sun Nov 17 12:21:16 2024 +0000 basic one-way sync 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