Code Monkey home page Code Monkey logo

macro-deck-discord-plugin's Introduction

Macro Deck Discord Plugin

GitHub

A plugin for Macro Deck 2 to interact with a local Discord client.

NOTE: This plugin uses the official RPC API from Discord, however it is currently in "private beta". Expect things to break at some point in the future if they modify the API after coming out of beta, whenever that may be.

If you like my work and want to support/encourage me in making more plugins, you certainly can do so on Ko-Fi.

ko-fi

Features

Variables

This plugin updates the following variables for use anywhere variables are allowed in Macro Deck 2

Variable Name Description
discord_is_self_deafened True if you are deafened from the client end
discord_is_server_deafened True if you are deafened from the server end
discord_is_any_deafened True if you are deafened from either the client or server end
discord_is_self_muted True if you are muted from the client end
discord_is_server_muted True if you are muted from the server end
discord_is_any_muted True if you are muted from either the client or server end

Actions

This plugin adds the following actions

Mute Actions

Action Description
Set Mute On Set your self mute status to muted
Set Mute Off Set your self mute status to unmuted
Toggle Mute Toggle your self mute status

Deafen Actions

Action Description
Set Deaf On Set your self deafen status to deafened
Set Deaf Off Set your self deafen status to undefeaned
Toggle Deaf Toggle your self deafen status

Webhook Actions

Action Description
Execute Webhook Use a webhook to send a message to a particular channel.
Allows setting:
  - Bot name
  - Message
  - Embedded media (image, vide, etc.)

Rich Presence Actions

Action Description
Set Rich Presence Set a custom rich presence on your profile

NOTE: Image keys can only be asset names in your app Rich Presence -> Art Assets page
Clear Rich Presence Erase current custom rich presence (only removes presence set by this plugin)

*Custom rich presence shows up in "Activity" on your profile and in your status if not disallowed


NOTE: There are currently no actions that can be performed on the server side as there is no bot integration with this. If there is a large demand for bot integration to handle those kinds of actions, that may come at a later date.

Installation

Download/Install it directly in Macro Deck from the package manager.

Configuration

Visual learner? Here is my video tutorial for setting up this plugin in Macro Deck 2
Macro Deck 2 Discord Plugin | Installation & Configuration

Discord Application

NOTE: Due to the nature of OAuth2.0 requiring a client secret to stay, well secret, it is impossible for Macro Deck contributors to set up a single application as all of the source is shared which would include the secret. This means you will need to create your own application to use with this plugin. Don't worry, it's not hard to do.

To create your own Discord application:

  1. Go to Discord Developer Portal
  2. Click the "New Application" button in the top right corner
  3. Name the application (You can just use "Macro Deck Plugin" or anything really, it's yours)
  4. On the OAuth2 page, add a Redirect of "https://127.0.0.1"
    • Note the Client Id and the Client Secret on this page
    • You will enter these in the Macro Deck plugin configuration screen shortly
    • The Public Key IS NOT the same as the Client Secret. Make sure you copy the right one.
  5. BE SURE TO CLICK SAVE!
    • It is very easy to miss the green button at the bottom of the screen

Macro Deck 2

  1. Open Macro Deck 2 application on your computer
  2. Switch to the plugin manager view and locate the discord plugin (install if necessary)
  3. Click the "Configure" button
  4. Enter the Client Id and Client Secret noted before
    • Debug Field a. Only check this if requested by Macro Deck Discord mod (or if you are curious) b. Could have a performance impact due to attempted sensitive information scrubbing i. IT IS STILL YOUR RESPONSIBLITY to ensure sensitive data is removed or redacted before sending log files
  5. If your Discord application hasn't already popped up, switch to it
  6. It should be asking if your Discord Application can connect and do certain things on your client. Here you should allow it to.
    • If it doesn't pop up, make sure you copied the correct Client Id and Client Secret. Clear out the configuration and re-enter them.

After that, you should be able to watch the discord_* variables change when you change your mute/deafen state while in a voice channel

Addendum

Not a Standalone App

This is a plugin for Macro Deck 2, it does NOT function as a standalone app

Third Party Licenses / Thank you

This plugin is built upon the shoulders of giants. Here are their licenses:

The icons used are not mine:

macro-deck-discord-plugin's People

Contributors

recklessboon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

rubiross

macro-deck-discord-plugin's Issues

Connection issue

For the life of me i cannot get it 2 connect 2 discord never ask for permission iv tried everything i know. plz help

Variable self

when my friend turns off the microphone or sound, my "self" variable changes. You can see this in the first picture, where I'm unmuted, but the variables say otherwise.
1
2
3

Noise supression toggle

I would like to see the option to toggle the noise suppression.

If it is possible to select the noise suppression mode when you use the button to turn it on or off. (krisp or standard)

I'm not sure how useful it will be for others, but it will be very beneficial for me.

Connection Icon Blinking

Recently got a Discord update and now in Macro Deck the Discord connection icon keeps blinking between Connected/Disconnected.

EDIT

Nevermind. Just noticed a second rogue instance of Discord was stuck running in the background when I was getting horrible FPS in a game. It connects now.

Image Key and the Image Text is inverted

Hi, i found a "bug" on your last update on the action "set rich presence" there have one problem, the Large Image Key and the Large Image Text is inverted, same for Small Image key and Small Image Text

That all for now :)
Have a nice day

connection problem

I'm pretty sure everything set up right with video guide,but still can't connect to discord.
When I turn on debug the log says that:

[ERROR]: Failed to process event! Error converting value {null} to type 'DiscordRPC.User+PremiumType'. Path 'user.premium_type'.
[ERROR]: Data: {"cmd":"DISPATCH","data":{"v":1,"config":{"cdn_host":"cdn.discordapp.com","api_endpoint":"//discord.com/api","environment":"production"},"user":{"id":"","username":"","discriminator":"","avatar":"","bot":false,"flags":0,"premium_type":null}},"evt":"READY","nonce":null}

Is that means I need premium to use discord API?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.