Mute/unmute myself in Discord programatically (and if possible locally)

1.1k Views Asked by At

Is there a way to programmatically mute or unmute (later also deafen or un-deafen) myself in Discord (similar to manually doing it by pressing the small microphone icon in the bottom left corner)? I know I can configure a hotkey for this (and yes, I could "trigger" the hotkey programmatically) but that's not what I want here.

Preferably the solution just works locally without calling any REST APIs or such, just by interacting with the local Discord Client through some kind of API, but if that's just absolutely not possible, than calling a REST API would be okay, too.

I tried using the Discord Game SDK, but it seems to be rather limited when it comes to something like this.

1

There are 1 best solutions below

9
Ved On

The "some kind of API" you're asking for may be the Electron devtools (basically your typical web browser tools). On your Discord client you can open it with CTRL + SHIFT + I. Note that they've disabled it by default on stable builds to keep users safe.

you can turn it back on by setting "DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true in %appdata%/discord/settings.json.

You can try interacting with the client through JavaScript on the console. Whether it's useful to you depends on your requirements though.