Skip to content
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,46 @@ client->UpdateRichPresence(
```
---

## Setting Field URLs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both of these sections would be better just below ## Setting Assets since it flows naturally from there.

I am wondering though if that section should be ## Setting Predefined Assets and this should be something like ## Setting Rich Presence Clickable Links or something like that - that describes what you are doing.

What do you think of that?

Down here we're in ## Rich Presence Without Authentication which feels like the wrong section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im good with moving them! i think that makes sense

i'm like 70% sure that you can set more than just predefined assets so i dont think renaming that section is necessary. as for renaming the field URLs section, i think it's redundant to say Rich Presence when we're on the rich presence page but i'm open to maybe doing "Setting Clickable Links" if that feels more intuitive to you than "Setting Field URLs"

so in the meantime ive moved the section, but left the headers the same. lmk your thoughts on if you still think the header could be reworded


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.

```cpp
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);
```

---

## Configuring Status Text

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.

```cpp
// 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);
```

---

## Next Steps

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