diff --git a/docs/discord-social-sdk/development-guides/setting-rich-presence.mdx b/docs/discord-social-sdk/development-guides/setting-rich-presence.mdx index 53e1c05e6a..2c7a61118d 100644 --- a/docs/discord-social-sdk/development-guides/setting-rich-presence.mdx +++ b/docs/discord-social-sdk/development-guides/setting-rich-presence.mdx @@ -1,7 +1,6 @@ --- sidebar_label: Setting Rich Presence --- -import PublicClient from '../partials/callouts/public-client.mdx'; import SupportCallout from '../partials/callouts/support.mdx'; [Home](/docs/intro) > [Discord Social SDK](/docs/discord-social-sdk/overview) > [Development Guides](/docs/discord-social-sdk/development-guides) > {sidebar_label} @@ -198,6 +197,55 @@ activity.SetSupportedPlatforms(discordpp::ActivityGamePlatforms::Desktop); See the `ActivityGamePlatforms` enum for all supported platforms. +## Rich Presence Without Authentication + +:::warn +Rich Presence via RPC (Remote Procedure Call) will only work with a running Discord desktop client. It does not support mobile, console or web clients. +::: + +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 desktop client through RPC (Remote Procedure Call). + +### Setting Up Direct Rich Presence + +To use Rich Presence without authentication, simply: + +1. Set your application ID using [`Client::SetApplicationId`] +2. Configure your activity details +3. Call [`Client::UpdateRichPresence`] + +```cpp +auto client = std::make_shared(); + +// 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"; + } + }); +``` + +### Requirements + +* Discord desktop client must be running on the user's machine +* 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 Discord desktop clients are running. + --- ## Next Steps @@ -228,4 +276,7 @@ Now that you've set up Rich Presence, you might want to explore: {/* Autogenerated Reference Links */} [`Activity`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Activity.html#ae793d9adbe16fef402b859ba02bee682 -[`ActivityTypes`]: https://discord.com/developers/docs/social-sdk/namespacediscordpp.html#a6c76a8cbbc9270f025fd6854d5558660 \ No newline at end of file +[`ActivityTypes`]: https://discord.com/developers/docs/social-sdk/namespacediscordpp.html#a6c76a8cbbc9270f025fd6854d5558660 +[`Client::Connect`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a873a844c7c4c72e9e693419bb3e290aa +[`Client::SetApplicationId`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ad452335c06b28be0406dab824acccc49 +[`Client::UpdateRichPresence`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#af0a85e30f2b3d8a0b502fd23744ee58e \ No newline at end of file