Skip to content

Configuring Discord Rich Presence (v1.7)

Daniel Andrusiewicz edited this page Oct 3, 2024 · 1 revision

Written by @Lust

Create a new Rich Presence application

  1. Go to the Discord Developers Portal (and log in with your Discord account).

  2. Create a "New Application" (top right of the page), and give it the name that you want to show up in Discord: for example, "NSMB My Amazing Mod".

  3. Once you created the Application head over to Rich Presence to the left and click on it,

  4. You can add a Cover Image this Image will be the Game has ended. Image if Discord Game Invites was used for a session.

  5. Under Rich Presence Assets you can add Images to the Levels showing up in the RPC and Main Menu, For Levels you Need to Name it level-(Rich Presence Id) e.g. level-grassland, to check what your Levels rich presence id is, or if you already had it, open a Level Scene in the Editor and go to the Inspector and check Rich Presence Id, if you put in a let's say Sewer Level, you can call it sewers so the Name would be level-sewer, for the main menu Picture, just call the uploaded Image mainmenu and your good to go!

Note: Changes to the uploaded images can take some time for Discord to properly cache. If you see an old or blank image, it is possible that Discord is still rolling out your changes. Alternatively, you might have named your image incorrectly.

Configure Unity

  1. Open Unity and go to Assets/Scripts and open the DiscordController.cs script.

  2. Line 19 contains the Application ID used for the base game:

    discord = new Discord.Discord(962073502469459999, (ulong) CreateFlags.NoRequireDiscord);

    Replace the Application ID (962073502469459999) with the ID found in the Developer Portal under the "General Information" tab. Changing this will tell Discord to use your application's name and images, rather than the base game's.##

Replacing the RPC text (optional)

This is for changing the default text for the RPC: "Playing Online", "In a Public/Private Lobby", "Browsing the Main Menu...", etc.

  1. Go back to the DiscordController.cs (in Assets/Scripts). Everything related to the actual state (text, images, "Ask to Join" links) of the RPC is located under the UpdateActivity() method, starting on Line 71.

  2. Change the text that gets assigned to activity.Details, activity.State, and assets.LargeImage (if you have custom images). If you can't find where a certain string is located, use Ctrl+F to search for it.

  3. Save the script's changes. When testing, make sure that your platform isn't set to "WebGL", as WebGL builds are not compatible with Discord RPC.