Discord/Studio Rich Presence Plugin [OPEN-SOURCE]

IMPORTANT

Please do not use this, use StudioPresence instead.

roblox-discord-presence

A plugin/local http server pair which connects to your discord client and sets your development status.

Feel free to contribute code, README contributions must be substantial.

Examples


Features

  • Customizable Text
  • Script context variables:
    • $SCRIPT_NAME - Name of the script currently being edited.
    • $SCRIPT_LINES - Count of the script’s lines.
    • $SCRIPT_PARENT - Name of the script’s parent.
    • $ACTIVITY:... - Activity status (Idle/Away) or if a script is actively being edited, selects text after the :.
    • $WORKSPACE - Place name/File name.
    • $PLACE_ID - Place name/“0”.
    • $PLACE_PUBLISHED:...:... - If place published then first option otherwise second option.
    • (More to come, feel free to add your own)
  • Supports buttons (2 max.)
  • In-Studio configuration UI
  • Toggleable

Installation

  • The plugin is available here (DRPC_client), and here (direct plugin).
  • The server is slightly more complicated to set up:
    • To begin, you’ll need an installation of Node.
    • Next, download the DRPC_server, extract the files from the zip into a new folder.
    • Launch the command prompt in that file.
    • Run npm i followed by node index.js (The latter will be your startup command whenever you need it running).
    • As of right now, you’ll be required to launch it at startup yourself until I make it a windows service, and you’ll also have to keep the command prompt open.
  • Once the plugin and server are running on a place at the same time, you should see your rich presence change as long as your discord settings are correct:
    User Settings > Game Activity > Display currently running game as a status messageEnabled.

If it doesn’t work and you’ve correctly followed the steps, either contribute to this very barebones installation guide to fix it for others, or submit an issue.

FAQ

  • Q: My buttons aren’t working?
    A: You aren’t actually able to click your own buttons unless you’re using a client such as BBD, everyone else can.

Special Thanks to

@Baileyeatspizza - Scripting

@va1kio - UI Design/Scripting

@Kunal0004 - Testing

93 Likes

This looks amazing. I don’t really know if something like this already existed, but this is definitely something that I would love to have by default.

2 Likes

Roblox’s opinion of Discord is borderline aggressive, so I doubt it would ever happen on it’s own. Haven’t found any public rich presence plugins for studio on the way, so hope there aren’t any that put me to shame, but I’ll keep working on this one.
Glad you’re interested! :smiley:

9 Likes

Minor Bug-fix (v0.1.1-alpha)

Fixes:

  • activity#buttons label/url mismatch
  • Offline $WORKSPACE identification default’ing
  • Minor data system work.

Available here.

I think there might be something wrong with the buttons feature, because it seems like the lower button keeps saving with the top button’s data, and it’s extremely difficult for me to edit the bottom button at all. Even with these settings:


Discord will show this:
image
And the buttons won’t do anything, but that could just be me using BetterDiscord.
I did get this error a lot though:

This looks very promising, and if you can fix these issues I’ll probably use it most of the time!

2 Likes

I’ll work on them today, I already fixed the child 'buttons' one in v0.1.1-alpha. But I’ll make sure to take a look into the 2 identical buttons issue.

1 Like

Fixed buttons/Added script context variables (v0.1.2-alpha)

Fixes

  • Button saving/usage displaced to first fields. (@NobleReign)

Features

  • Buttons use text processing.
  • Extra text processing context variables:
    • $PLACE_ID - ID of the current place or “0”.
    • $PLACE_PUBLISHED:...:.... - If published then display option 1 otherwise display option 2

Available here.

2 Likes

Also, don’t be worried about your buttons not doing anything, it’s a weird Discord feature in general where a person can’t click their own buttons, anyone else can though.

2 Likes

Yay, an updated version of Roblox RPC. I cannot wait to give it a try.

Will u make support for the Roblox game too? Like another RPC?

This is awesome! Can’t wait for the future updates. Currently, it’s kinda annoying to keep running Command Prompt all the time, but still it’s cool. Love rickrolling people with those buttons :laughing:

Edit: While doing this, I updated the first button’s link and button title - but the link didn’t update on discord. The title updated.

image

1 Like

is this safe? i literally saw a javascript file while downloading

It’d be a lot harder to do, you can’t send even local HTTP requests from the Roblox client. I’ll take a look at iframe detection and the presences API for it but I’d estimate another few days at least before it’s available for clients.

Love rickrolling people with those buttons

Haha that’s the first thing I did too!

Edit: While doing this, I updated the first button’s link and button title - but the link didn’t update on discord. The title updated.

You can’t actually click your own buttons, so I’m not sure how you tested this, if you provide some extra details I’ll look into it. (It can take up to a minute for links to update for other people)

Currently, it’s kinda annoying to keep running Command Prompt all the time, but still it’s cool.

I’ll be working on making it a background process/windows service in the future so it’ll take one batch run and you’ve got it for life.

You can open the JS file with any editor if you don’t trust it’s contents. All it is is a NodeJS script, it is what runs on your computer to allow Roblox to interface with Discord’s RPC. Hope you enjoy using it :smiley:

1 Like

I hate how the source code is a big module mess, every module gets some other module which then requires more modules and which then requires even more modules resulting in a giant mess

Thanks for fixing the bug, I can safely say that this works remarkably well now! It actually looks really professional to me… Definitely gonna use this often, and I’m excited to see what kind of new features we’ll see in the future!
image

3 Likes

I think there might be something wrong with the script, every time In studio I press enabled I get 1 error, as shown below


Do you know any fix to this or did I do something wrong?

Also, I got this error when I restarted Roblox, and the cmd prompt

1 Like

It’s a lot cleaner than the alternative of jamming completely unrelated code all together in a single large script. If you have a better idea of a code-placement standard, feel free to modify the plugin’s source with Rojo/Git and submit a pull request on the GitHub.

Currently fixing that, noticed it a little earlier.

Oh ok, good to know.

Quick question do you store the discord cookies? or cookies to logg it?