basic one-way sync
This commit is contained in:
commit
2ee8ea5c1e
1 changed files with 22 additions and 0 deletions
22
index.ts
Normal file
22
index.ts
Normal file
|
@ -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
|
||||
}
|
||||
});
|
Loading…
Reference in a new issue