Skip to content

Commit ce65798

Browse files
authored
Document new rich presence url & status display type fields for Social SDK (#7676)
* add examples for social sdk * add to gateway events * add changelog entry * split out social sdk changes into separate pr * add back social sdk changes * remove changelog * revert gateway events changes * reorganize sections
1 parent 438d213 commit ce65798

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,46 @@ If you need more than 300 custom assets or want to use images stored somewhere e
164164

165165
---
166166

167+
## Setting Field URLs
168+
169+
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.
170+
171+
```cpp
172+
activity.SetState("Playing on Mainframe");
173+
activity.SetStateUrl("https://example.com/maps/mainframe");
174+
activity.SetDetails("Rank #1337 in global leaderboard");
175+
activity.SetDetailsUrl("https://example.com/leaderboard/global");
176+
177+
discordpp::ActivityAssets assets;
178+
assets.SetLargeImage("map-mainframe");
179+
assets.SetLargeText("Mainframe");
180+
assets.SetLargeUrl("https://example.com/maps/mainframe");
181+
assets.SetSmallImage("tank-avatar");
182+
assets.SetSmallText("Tank");
183+
assets.SetSmallUrl("https://example.com/classes/tank");
184+
185+
activity.SetAssets(assets);
186+
```
187+
188+
---
189+
190+
## Configuring Status Text
191+
192+
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.
193+
194+
```cpp
195+
// uses the game's name in the status text (default)
196+
activity.SetStatusDisplayType(discordpp::StatusDisplayTypes::Name);
197+
198+
// uses the activity's state field in the status text
199+
activity.SetStatusDisplayType(discordpp::StatusDisplayTypes::State);
200+
201+
// uses the activity's details field in the status text
202+
activity.SetStatusDisplayType(discordpp::StatusDisplayTypes::Details);
203+
```
204+
205+
---
206+
167207
## Setting Party and Join Secret
168208

169209
You can also include party details and a join secret in your Rich Presence to power Game Invites. Check out the [Game Invites guide](/docs/discord-social-sdk/development-guides/managing-game-invites) for more information.
@@ -245,6 +285,7 @@ client->UpdateRichPresence(
245285
}
246286
});
247287
```
288+
248289
---
249290
250291
## Next Steps

0 commit comments

Comments
 (0)