Discord
Included with Macro DeckMute, deafen, join voice channels, change voice settings and post webhook messages in Discord from your deck.
The Connect Discord dialog with the Client ID and Client Secret fields
- Mute and deafen buttons that show your real state
- Join or leave voice channels and open text channels
- Set microphone and output volume, voice mode and voice processing
- Show a custom Rich Presence activity on your profile
- Post messages and embeds to a channel through a webhook
The Discord integration connects Macro Deck to the official Discord desktop app on the same computer. It uses Discord's local RPC interface, the same one Discord offers to apps that control the client, so your buttons act as if you clicked in Discord yourself. Discord only gives this access to applications you own, so the setup asks you to create a free application in the Discord Developer Portal and authorize it once.
What you can do
- Mute or deafen yourself with Microphone Mute and Deafen. The button shows whether you are muted, also when you mute in Discord itself.
- Join a voice channel on one of your servers, leave the current one, or open a text channel in the Discord app.
- Set, raise or lower your microphone and output volume, switch between Push to talk and Voice activity, and turn standard noise suppression, echo cancellation and automatic gain control on or off.
- Show a custom activity on your profile with Set Rich Presence, and remove it again with Clear Rich Presence.
- Post a message, with an optional embed, to any channel through a webhook with Execute Webhook. This action works without setting up the integration, as long as the integration is turned on.
Some example setups:
- A Mic button with Microphone Mute in Toggle mode, whose color follows the
discord_is_self_mutedvariable. - A button that joins your team's voice channel and turns on Move me if I am already connected, so it also works while you are in another channel.
- A flow on the Microphone Silenced trigger that turns on a red light, and one on Microphone Live that turns it off again.
- A button that posts "Stream is live" with a link to your channel through a webhook.
How it behaves
Macro Deck connects to Discord when it starts and reconnects by itself when you close and reopen Discord, waiting a little longer after each failed try, up to one minute. The Connected and Disconnected triggers fire when that happens. While Discord is not connected, the variables read as unavailable, except discord_is_connected. Changes you make in Discord, and mutes by a moderator, show up in the variables and triggers right away. You can set up one Discord account.
What you need
- The official Discord desktop app, running on the same computer as Macro Deck. On Linux, the Flatpak and Snap versions work too.
- A Discord account and a free application of your own in the Discord Developer Portal.
- Macro Deck and Discord started with the same privileges (neither of them as administrator, or both).
- For Execute Webhook only: a webhook URL from a channel. It needs the integration turned on, but no setup.
Set it up
Step 1: Create a Discord application
Open the Discord Developer Portal and create a new application. The name does not matter. Copy the Application ID from General Information: this is the Client ID.
Step 2: Add the redirect URI and copy the secret
In your application, open OAuth2. Add
http://localhost/as a redirect and save. Nothing ever opens this address, Discord only checks that it is registered. Then copy the Client Secret (reset it if Discord does not show it).Step 3: Open Discord in Macro Deck
Make sure the Discord desktop app is running. In Macro Deck, click Integrations in the sidebar and click Discord.
Step 4: Enter the Client ID and Client Secret
On the Overview tab, click Set up in the Configuration section. Turning on the switch at the top right opens the same dialog. In the Connect Discord dialog, paste the Client ID and the Client Secret and click Continue.
Step 5: Authorize in Discord
On the Authorize in Discord step, click Continue. Discord shows an authorization prompt for your application: accept it. Macro Deck saves the connection as Discord with your user name in parentheses and turns the integration on.
Step 6: Add an action to a button
On the Deck page, click a button. The deck must be unlocked: when the Lock button shows at the top right, it is. The editor opens with Short Press selected. Click + Add action, select Discord on the left of the Add action dialog, pick Microphone Mute and set Action to Toggle.
Step 7: Press the button
Press the button on your deck. Discord mutes your microphone, and the button shows the muted state until you unmute, from the deck or in Discord.
Actions14
Put these on a button or run them from a flow.
- Microphone Mute
- Mutes, unmutes or toggles your microphone.
- Deafen
- Deafens, undeafens or toggles deafen.
- Standard Noise Suppression
- Turns Discord's standard noise suppression on or off. It cannot control Krisp.
- Echo Cancellation
- Turns Discord's echo cancellation on or off.
- Automatic Gain Control
- Turns automatic gain control on or off.
- Set Voice Mode
- Switches between push to talk and voice activity, or toggles between them.
- Set Microphone Volume
- Sets, raises or lowers Discord's microphone volume.
- Set Output Volume
- Sets, raises or lowers Discord's output volume, up to 200%.
- Join Voice Channel
- Connects you to a voice channel on one of your servers, optionally moving you from another channel.
- Leave Voice Channel
- Disconnects you from the current voice channel.
- Open Text Channel
- Opens a text channel in the Discord app.
- Set Rich Presence
- Shows a custom activity (playing, listening to, watching or competing in) with details, images and elapsed time on your profile.
- Clear Rich Presence
- Removes the activity Macro Deck set on your profile.
- Execute Webhook
- Sends a message, optionally with an embed, to a channel through a webhook URL. Works without setup.
Triggers18
A button or flow can react to these events.
- Connected
- Macro Deck connected to the Discord app.
- Disconnected
- The Discord app was closed or the connection dropped.
- Microphone Muted
- You muted your own microphone.
- Microphone Unmuted
- You unmuted your own microphone.
- Deafened
- You deafened yourself.
- Undeafened
- You undeafened yourself.
- Server Muted
- A moderator muted you.
- Server Unmuted
- A moderator unmuted you.
- Server Deafened
- A moderator deafened you.
- Server Undeafened
- A moderator undeafened you.
- Microphone Silenced
- Your microphone stopped transmitting for any reason: a mute or deafen by you or a moderator.
- Microphone Live
- Your microphone can transmit again: no mute and no deafen is in effect.
- Voice Channel Joined
- You joined a voice channel, optionally only a specific one.
- Voice Channel Left
- You left a voice channel, optionally only a specific one.
- Voice Connection State Changed
- Discord's voice connection changed state, for example to
VOICE_CONNECTED, with the average ping. - Someone Started Speaking
- Someone in your current voice channel started speaking, with whether it is you.
- Someone Stopped Speaking
- Someone in your current voice channel stopped speaking, with whether it is you.
- Notification Received
- Discord showed a desktop notification, with its title and text.
Variables11
Show these values on buttons and widgets, or use them in conditions.
discord_is_connected- Whether Macro Deck is connected to the Discord app.
discord_user_name- The name of the connected account.
discord_is_self_muted,discord_is_self_deafened- Whether you muted or deafened yourself.
discord_is_server_muted,discord_is_server_deafened- Whether a moderator muted or deafened you.
discord_is_muted,discord_is_deafened- Whether you are muted or deafened for any reason.
discord_is_speaking- Whether you are speaking right now.
discord_is_in_voice_channel,discord_voice_channel,discord_voice_server- Whether you are in a voice channel, and the names of the channel and its server.
discord_voice_connection_state,discord_voice_ping- The state of the voice connection and its average ping in milliseconds.
discord_input_volume,discord_output_volume- Discord's input and output volume in percent. You can also set them, for example with a slider.
discord_voice_mode- Whether Discord uses push to talk or voice activity.
discord_noise_suppression,discord_echo_cancellation,discord_automatic_gain_control- Whether noise suppression, echo cancellation and automatic gain control are on.
Frequently asked questions
Why do I need my own Discord application?
Discord only grants the permissions to control the client to applications you are on the team of. Your own application is free, and Macro Deck uses its Client ID and Client Secret only to authorize with Discord.
Does it work with Vesktop, Legcord or other Discord clients?
No. Third-party clients can share game activity, but Macro Deck cannot control them. Start the official Discord desktop app; the other client can keep running alongside it.
Does it work when Discord runs on another computer?
No. Macro Deck talks to Discord through a local connection, so Discord has to run on the computer that runs Macro Deck. Only Execute Webhook works without the Discord app.
Setup says Discord refused the connection. What is wrong?
Macro Deck and Discord run with different privileges, for example one of them was started with Run as administrator. Start both the same way and try again.
A voice setting does not change. Why?
Another app connected to Discord may hold the voice settings, or Discord ignores advanced voice settings while Krisp is active. Close other apps that control Discord, change the setting once in Discord's Voice & Video settings, then run the action again.
Where are my credentials stored?
The Client Secret and the tokens Discord returns are stored encrypted on your computer and only sent to Discord. When Discord no longer accepts the stored authorization, the integration shows Discord authorization expired with a Reconnect button.
More in Chat and voice
Discord Webhooks
Included with Macro DeckPost rich messages with embeds and mentions to Discord channels through webhooks, with a live preview.
SinusBot
Included with Macro DeckControl the music of your SinusBot instances and show what they play on your deck.