Skip to content

Commit e10a521

Browse files
authored
Rich Presence Activity Invite Cover Image: Update docs around how to add an invite cover image (#7902)
* wip docs update * cleanup
1 parent 1931f7a commit e10a521

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

docs/discord-social-sdk/development-guides/managing-game-invites.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,18 @@ yourgame://_discord/join?secret=the_join_secret_you_set
456456

457457
---
458458

459+
## Setting a Cover Image for the Invite (Optional)
460+
461+
You can set a cover image for an invite via rich presence activity. This image displays as the banner on the invite and helps draw attention to it. Setting a cover image via rich presence allows you to dynamically customize invites per rich presence activity; for example, showing different images based on game mode, map, etc. rather than using the same static image for all invites. If not set, the banner falls back to the "Rich Presence Invite Image" configured in the Developer Portal under the "Rich Presence" tab. Setting an invite cover image is entirely optional.
462+
463+
```cpp
464+
discordpp::ActivityAssets assets;
465+
assets.SetInviteCoverImage("invite-cover-image"); // This example uses an asset key, but you can use an external URL asset for more dynamic cover images.
466+
activity.SetAssets(assets);
467+
```
468+
469+
---
470+
459471
## Next Steps
460472

461473
<Container>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ activity.SetTimestamps(timestamps);
146146

147147
## Setting Assets
148148

149-
Once you've uploaded assets to your app, you can reference them using their **asset key** in your code to set custom artwork in Rich Presence. Here's an example of an asset with the key of "map-mainframe" and "tank-avatar":
149+
Once you've uploaded assets to your app, you can reference them using their **asset key** in your code to set custom artwork in Rich Presence. Here's an example of an asset with the key of "map-mainframe", "tank-avatar", and "invite-cover-image":
150150

151151
```cpp
152152
// Setting Activity Assets
@@ -155,6 +155,7 @@ assets.SetLargeImage("map-mainframe");
155155
assets.SetLargeText("Mainframe");
156156
assets.SetSmallImage("tank-avatar");
157157
assets.SetSmallText("Tank");
158+
assets.SetInviteCoverImage("invite-cover-image"); // Used for Game Invites
158159
activity.SetAssets(assets);
159160
```
160161

docs/events/gateway-events.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,14 +1219,15 @@ For Listening and Watching activities, you can include both start and end timest
12191219

12201220
###### Activity Assets
12211221

1222-
| Field | Type | Description |
1223-
|--------------|--------|----------------------------------------------------------------------------------------------|
1224-
| large_image? | string | See [Activity Asset Image](/docs/events/gateway-events#activity-object-activity-asset-image) |
1225-
| large_text? | string | Text displayed when hovering over the large image of the activity |
1226-
| large_url? | string | URL that is opened when clicking on the large image |
1227-
| small_image? | string | See [Activity Asset Image](/docs/events/gateway-events#activity-object-activity-asset-image) |
1228-
| small_text? | string | Text displayed when hovering over the small image of the activity |
1229-
| small_url? | string | URL that is opened when clicking on the small image |
1222+
| Field | Type | Description |
1223+
|---------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1224+
| large_image? | string | See [Activity Asset Image](/docs/events/gateway-events#activity-object-activity-asset-image) |
1225+
| large_text? | string | Text displayed when hovering over the large image of the activity |
1226+
| large_url? | string | URL that is opened when clicking on the large image |
1227+
| small_image? | string | See [Activity Asset Image](/docs/events/gateway-events#activity-object-activity-asset-image) |
1228+
| small_text? | string | Text displayed when hovering over the small image of the activity |
1229+
| small_url? | string | URL that is opened when clicking on the small image |
1230+
| invite_cover_image? | string | See [Activity Asset Image](/docs/events/gateway-events#activity-object-activity-asset-image). Displayed as a banner on a [Game Invite](/docs/discord-social-sdk/development-guides/managing-game-invites). |
12301231

12311232
###### Activity Asset Image
12321233

0 commit comments

Comments
 (0)