Skip to content

Commit 5482bab

Browse files
committed
add back social sdk changes
1 parent d0cab1a commit 5482bab

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

docs/discord-social-sdk/development-guides/setting-rich-presence.mdx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,46 @@ See the `ActivityGamePlatforms` enum for all supported platforms.
200200

201201
---
202202

203+
## Setting Field URLs
204+
205+
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.
206+
207+
```cpp
208+
activity.SetState("Playing on Mainframe");
209+
activity.SetStateUrl("https://example.com/maps/mainframe");
210+
activity.SetDetails("Rank #1337 in global leaderboard");
211+
activity.SetDetailsUrl("https://example.com/leaderboard/global");
212+
213+
discordpp::ActivityAssets assets;
214+
assets.SetLargeImage("map-mainframe");
215+
assets.SetLargeText("Mainframe");
216+
assets.SetLargeUrl("https://example.com/maps/mainframe");
217+
assets.SetSmallImage("tank-avatar");
218+
assets.SetSmallText("Tank");
219+
assets.SetSmallUrl("https://example.com/classes/tank");
220+
221+
activity.SetAssets(assets);
222+
```
223+
224+
---
225+
226+
## Configuring Status Text
227+
228+
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.
229+
230+
```cpp
231+
// uses the game's name in the status text (default)
232+
activity.SetStatusDisplayType(discordpp::StatusDisplayTypes::Name);
233+
234+
// uses the activity's state field in the status text
235+
activity.SetStatusDisplayType(discordpp::StatusDisplayTypes::State);
236+
237+
// uses the activity's details field in the status text
238+
activity.SetStatusDisplayType(discordpp::StatusDisplayTypes::Details);
239+
```
240+
241+
---
242+
203243
## Next Steps
204244

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

0 commit comments

Comments
 (0)