muter-vencord/index.ts

22 lines
569 B
TypeScript
Raw Normal View History

2024-11-17 12:21:16 +00:00
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
}
});