Skip to content

Commit b2ae518

Browse files
authored
Add Setting Buttons section to Rich Presence Social SDK guide (#8255)
Documents ActivityButton usage with C++, Unity, and Unreal examples, and notes that buttons are only visible to other users — not yourself.
1 parent f1ca98f commit b2ae518

1 file changed

Lines changed: 61 additions & 4 deletions

File tree

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

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,61 @@ activity.SetAssets(assets);
189189

190190
---
191191

192+
## Setting Buttons
193+
194+
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.
195+
196+
<CodeGroup>
197+
198+
```cpp C++
199+
discordpp::ActivityButton buyButton;
200+
buyButton.SetLabel("Buy On Steam!");
201+
buyButton.SetUrl("https://store.steampowered.com/app/AppID/GameName/");
202+
203+
discordpp::ActivityButton communityButton;
204+
communityButton.SetLabel("Join the Community!");
205+
communityButton.SetUrl("https://discord.gg/your-discord-url-or-id");
206+
207+
activity.AddButton(buyButton);
208+
activity.AddButton(communityButton);
209+
```
210+
211+
```csharp Unity
212+
ActivityButton buyButton = new ActivityButton();
213+
buyButton.SetLabel("Buy On Steam!");
214+
buyButton.SetUrl("https://store.steampowered.com/app/AppID/GameName/");
215+
216+
ActivityButton communityButton = new ActivityButton();
217+
communityButton.SetLabel("Join the Community!");
218+
communityButton.SetUrl("https://discord.gg/your-discord-url-or-id");
219+
220+
activity.AddButton(buyButton);
221+
activity.AddButton(communityButton);
222+
```
223+
224+
```cpp Unreal
225+
UDiscordActivityButton* BuyButton = NewObject<UDiscordActivityButton>();
226+
BuyButton->Init();
227+
BuyButton->SetLabel("Buy On Steam!");
228+
BuyButton->SetUrl("https://store.steampowered.com/app/AppID/GameName/");
229+
230+
UDiscordActivityButton* CommunityButton = NewObject<UDiscordActivityButton>();
231+
CommunityButton->Init();
232+
CommunityButton->SetLabel("Join the Community!");
233+
CommunityButton->SetUrl("https://discord.gg/your-discord-url-or-id");
234+
235+
Activity->AddButton(BuyButton);
236+
Activity->AddButton(CommunityButton);
237+
```
238+
239+
</CodeGroup>
240+
241+
<Tip>
242+
Buttons are only visible to **other users** — you cannot see buttons on your own Rich Presence. To test that your buttons are working, use a second account or ask a friend to view your profile.
243+
</Tip>
244+
245+
---
246+
192247
## Configuring Status Text
193248
194249
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.
@@ -316,13 +371,15 @@ import {InboxIcon} from '/snippets/icons/InboxIcon.jsx'
316371
317372
## Change Log
318373
319-
| Date | Changes |
320-
|----------------|-----------------|
321-
| March 17, 2025 | Initial release |
374+
| Date | Changes |
375+
|----------------|-------------------------------|
376+
| March 31, 2026 | Added Setting Buttons section |
377+
| March 17, 2025 | Initial release |
322378
323379
{/* Autogenerated Reference Links */}
324380
[`Activity`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Activity.html#ae793d9adbe16fef402b859ba02bee682
325381
[`ActivityTypes`]: https://discord.com/developers/docs/social-sdk/namespacediscordpp.html#a6c76a8cbbc9270f025fd6854d5558660
326382
[`Client::Connect`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a873a844c7c4c72e9e693419bb3e290aa
327383
[`Client::SetApplicationId`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ad452335c06b28be0406dab824acccc49
328-
[`Client::UpdateRichPresence`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#af0a85e30f2b3d8a0b502fd23744ee58e
384+
[`Client::UpdateRichPresence`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#af0a85e30f2b3d8a0b502fd23744ee58e
385+
[`ActivityButton`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ActivityButton.html

0 commit comments

Comments
 (0)