Skip to main content
Documentation - Discord Docs

Search documentation

Type to search this documentation.

On this pageOverview

Setting Rich Presence

Rich Presence allows you to display detailed information about what players are doing in your game. Users can see this information in their Discord profile and friends list and use it to join their friends' games with Game Invites.

Before you begin, make sure you have:


Rich Presence allows you to display detailed information about players' actions in your game. Users can see this information in various places in Discord, including:

  • User profiles
  • Friend lists
  • Server member lists

Each Activity contains fields that describe the following:

Field Description Purpose
name Game or app name Displayed in the user's profile
type Activity type What the player is doing (e.g., "Playing", "Watching", "Listening")
details What the player is doing Main activity description (e.g., "Playing Capture the Flag")
state Their current status Secondary status (e.g., "In Queue", "In Match, "In a group")
party Party information Shows party size and capacity (e.g., "2 of 4")
timestamps Activity duration Shows elapsed or remaining time
assets Custom artwork Game/map thumbnails and character icons
secrets Join/spectate tokens Enable Game Invite functionality
supportedPlatforms Platform flags Control where join buttons appear

See below for examples of how to set these fields in your code.

When displayed in Discord, Rich Presence has three main components:

Playing "Your Game Name"          <- Line 1: Game name (automatic)
Capture the Flag | 2 - 1          <- Line 2: Details field
In a group (2 of 3)               <- Line 3: State + Party info

You can control how lines 2 and 3 are rendered in Discord, here's the breakdown:

  • Line 1, Playing "game name" is powered by the name of your game (or application) on Discord.
  • Line 2, Capture the flag | 2 - 1 is powered by the details field in the activity, and this should generally try to describe what the player is currently doing. You can even include dynamic data such as a match score here.
  • Line 3, In a group (2 of 3) describes the party the player is in. "Party" is used to refer to a group of players in a shared context, such as a lobby, server, team, etc. The first half, In a group is powered by the state field in the activity, and the second half, (2 of 3) is powered by the party field in the activity and describes how many people are in the current party and how big the party can get.

This diagram visually shows the field mapping:

Graphical representation of the legend for rich presence details


The Rich Presence invite image appears when invites are sent for a 3rd party game or app using the Discord Social SDK. After uploading an invite image for your app, you can see a preview of it to the right (under "IRL Invite Image Example").

Rich Presence invite image in app settings


While integrating Rich Presence, you'll likely want to upload custom art assets for your app. For all Rich Presence assets, it's highly recommended to make them 1024 x 1024.

To add custom assets for Rich Presence, navigate to your app's settings and click Rich Presence on the left-hand sidebar. On the Art Assets page, you can upload two different types of assets.

Rich Presence invite image in app settings

Up to 300 custom assets can be added to your app for later use when setting Rich Presence for a Discord user. These assets can be anything that help orient others to what a user is doing inside of your Activity or 3rd party game.

If you need more than 300 custom assets or want to use images stored somewhere else, you can also specify an external URL as long it still has the proper dimensions and size. Unlike uploaded assets, external URLs also support GIF, animated WebP, and AVIF.

When uploading Rich Presence assets, the asset keys will automatically be changed to lowercase. You can see this reflected in your app's settings after saving a newly uploaded asset, and you should keep it in mind when referencing any asset keys in your code.

Once you've uploaded these assets, you can use the asset key to reference them in your code when Setting Assets in Rich Presence.

Rich Presence assets in app settings


Here's a simple example setting the details and state of a Rich Presence activity:

C++
// Create a new activity
discordpp::Activity activity;
activity.SetType(discordpp::ActivityTypes::Playing);
activity.SetDetails("Battle Creek");
activity.SetState("In Competitive Match");

// Update the presence
client->UpdateRichPresence(activity, [](discordpp::ClientResult result) {
  if (result.Successful()) {
    std::cout << "✅ Rich presence updated!\n";
  }
});

By default, Rich Presence displays your application's name as it's registered on Discord (the top line of Rich Presence, e.g. Playing "My Game: Chapter Two"). You can override this displayed name by setting the name field on the activity with Activity::SetName before calling Client::UpdateRichPresence:

C++
// Override the displayed application name (top line of Rich Presence)
activity.SetName("My Game: Chapter Two");

You can include timestamps in your Rich Presence to display a live timer, such as how long a player has been in their current activity or how much time is left in a timed match. Timestamps are ActivityTimestamps set as Unix timestamps in seconds.

The direction of the timer is determined by which field you set:

  • Set the start time only to count up and show elapsed time (e.g. 12:34 elapsed).
  • Set the end time to count down and show the remaining time (e.g. 12:34 left).

To show how long the player has been in the activity, set ActivityTimestamps::SetStart to a time in the past, such as the current time. The timer counts up from that point.

C++
// Counting up: elapsed time since the activity started
discordpp::ActivityTimestamps timestamps;
// time(nullptr) returns the current Unix time in seconds, so the timer starts now
timestamps.SetStart(time(nullptr));
activity.SetTimestamps(timestamps);

To show how long until a timed activity ends, set ActivityTimestamps::SetEnd to a time in the future. The timer counts down to that point.

C++
// Counting down: time remaining until the activity ends (one hour from now)
discordpp::ActivityTimestamps timestamps;
// time(nullptr) is the current Unix time in seconds; + 3600 sets the end one hour from now
timestamps.SetEnd(time(nullptr) + 3600);
activity.SetTimestamps(timestamps);

Once you've uploaded assets to your app, you can reference them using their asset key in your code to set custom artwork in Rich Presence. Here's an example of an asset with the key of "map-mainframe", "tank-avatar", and "invite-cover-image":

C++
// Setting Activity Assets
discordpp::ActivityAssets assets;
assets.SetLargeImage("map-mainframe");
assets.SetLargeText("Mainframe");
assets.SetSmallImage("tank-avatar");
assets.SetSmallText("Tank");
assets.SetInviteCoverImage("invite-cover-image"); // Used for Game Invites
activity.SetAssets(assets);

You can set URLs for details, state, assets.large_image and assets.small_image in Rich Presence. When present, these URLs will make the corresponding image/text into clickable links.

C++
activity.SetState("Playing on Mainframe");
activity.SetStateUrl("https://example.com/maps/mainframe");
activity.SetDetails("Rank #1337 in global leaderboard");
activity.SetDetailsUrl("https://example.com/leaderboard/global");

discordpp::ActivityAssets assets;
assets.SetLargeImage("map-mainframe");
assets.SetLargeText("Mainframe");
assets.SetLargeUrl("https://example.com/maps/mainframe");
assets.SetSmallImage("tank-avatar");
assets.SetSmallText("Tank");
assets.SetSmallUrl("https://example.com/classes/tank");

activity.SetAssets(assets);

You can add up to two custom buttons to a player's Rich Presence. Each button has a label and a URL, making them a direct call to action for anyone viewing the presence — link out to your game's store page, website, or community server.

C++
discordpp::ActivityButton buyButton;
buyButton.SetLabel("Buy On Steam!");
buyButton.SetUrl("https://store.steampowered.com/app/AppID/GameName/");

discordpp::ActivityButton communityButton;
communityButton.SetLabel("Join the Community!");
communityButton.SetUrl("https://discord.gg/your-discord-url-or-id");

activity.AddButton(buyButton);
activity.AddButton(communityButton);
Unity
ActivityButton buyButton = new ActivityButton();
buyButton.SetLabel("Buy On Steam!");
buyButton.SetUrl("https://store.steampowered.com/app/AppID/GameName/");

ActivityButton communityButton = new ActivityButton();
communityButton.SetLabel("Join the Community!");
communityButton.SetUrl("https://discord.gg/your-discord-url-or-id");

activity.AddButton(buyButton);
activity.AddButton(communityButton);
Unreal
UDiscordActivityButton* BuyButton = NewObject<UDiscordActivityButton>();
BuyButton->Init();
BuyButton->SetLabel("Buy On Steam!");
BuyButton->SetUrl("https://store.steampowered.com/app/AppID/GameName/");

UDiscordActivityButton* CommunityButton = NewObject<UDiscordActivityButton>();
CommunityButton->Init();
CommunityButton->SetLabel("Join the Community!");
CommunityButton->SetUrl("https://discord.gg/your-discord-url-or-id");

Activity->AddButton(BuyButton);
Activity->AddButton(CommunityButton);

By default, Rich Presence will display the game's name in the user's status text. You can override this behavior by setting a status display type.

C++
// uses the game's name in the status text (default)
activity.SetStatusDisplayType(discordpp::StatusDisplayTypes::Name);

// uses the activity's state field in the status text
activity.SetStatusDisplayType(discordpp::StatusDisplayTypes::State);

// uses the activity's details field in the status text
activity.SetStatusDisplayType(discordpp::StatusDisplayTypes::Details);

You can also include party details and a join secret in your Rich Presence to power Game Invites. Check out the Game Invites guide for more information.

C++

// Setting Party Details
discordpp::ActivityParty party;
party.SetId("party1234");
party.SetCurrentSize(1);
party.SetMaxSize(5);
activity.SetParty(party);

// Setting Join Secret details
discordpp::ActivitySecrets secrets;
secrets.SetJoin("your-join-secret");
activity.SetSecrets(secrets);

You can set the supported platforms for your game in Rich Presence. This will control where the join buttons appear in Discord.

If you only want the join button to appear on desktop, you can set the supported platforms like this:

C++
activity.SetSupportedPlatforms(discordpp::ActivityGamePlatforms::Desktop);

See the ActivityGamePlatforms enum for all supported platforms.

Unlike most other features of the Discord Social SDK, Rich Presence can be set without authentication. Instead of using Client::Connect to authenticate with Discord, you can use Rich Presence functionality by directly communicating with a running Discord client through RPC (Remote Procedure Call).

  • The Discord desktop client must be running on the user's machine, or — on Android — the Discord app must be installed and signed in
  • Your application must be registered with Discord and have a valid Application ID

This direct approach makes Rich Presence integration much simpler for developers who only need basic presence functionality while a Discord client is available.

To use Rich Presence without authentication, simply:

  1. Set your application ID using Client::SetApplicationId
  2. Configure your activity details
  3. Call Client::UpdateRichPresence
C++
auto client = std::make_shared<discordpp::Client>();

// Set the application ID (no Connect() call needed)
client->SetApplicationId(APPLICATION_ID);

// Configure rich presence details
discordpp::Activity activity;
activity.SetType(discordpp::ActivityTypes::Playing);
activity.SetState("In Competitive Match");
activity.SetDetails("Rank: Diamond II");

// Update rich presence
client->UpdateRichPresence(
    activity, [](const discordpp::ClientResult &result) {
      if (result.Successful()) {
        std::cout << "🎮 Rich Presence updated successfully!\n";
      } else {
        std::cerr << "❌ Rich Presence update failed";
      }
    });

Now that you've set up Rich Presence, you might want to explore:

Need help? Join the Discord Developers Server and share questions in the #social-sdk-dev-help channel for support from the community.

If you encounter a bug while working with the Social SDK, please report it here: https://dis.gd/social-sdk-bug-report


Date Changes
August 3, 2026 Added Android support for Rich Presence without authentication
June 24, 2026 Clarified count-up vs count-down timestamps
June 5, 2026 Added Setting the Application Name section
March 31, 2026 Added Setting Buttons section
March 17, 2025 Initial release
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu