Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,18 @@ yourgame://_discord/join?secret=the_join_secret_you_set

---

## Setting a Cover Image for the Invite (Optional)

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.

```cpp
discordpp::ActivityAssets assets;
assets.SetInviteCoverImage("invite-cover-image"); // This example uses an asset key, but you can use an external URL asset for more dynamic cover images.
activity.SetAssets(assets);
```

---

## Next Steps

<Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ activity.SetTimestamps(timestamps);

## Setting Assets

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":
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":

```cpp
// Setting Activity Assets
Expand All @@ -155,6 +155,7 @@ assets.SetLargeImage("map-mainframe");
assets.SetLargeText("Mainframe");
assets.SetSmallImage("tank-avatar");
assets.SetSmallText("Tank");
assets.SetInviteCoverImage("invite-cover-image"); // Used for Game Invites
activity.SetAssets(assets);
```

Expand Down
17 changes: 9 additions & 8 deletions docs/events/gateway-events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1219,14 +1219,15 @@ For Listening and Watching activities, you can include both start and end timest

###### Activity Assets

| Field | Type | Description |
|--------------|--------|----------------------------------------------------------------------------------------------|
| large_image? | string | See [Activity Asset Image](/docs/events/gateway-events#activity-object-activity-asset-image) |
| large_text? | string | Text displayed when hovering over the large image of the activity |
| large_url? | string | URL that is opened when clicking on the large image |
| small_image? | string | See [Activity Asset Image](/docs/events/gateway-events#activity-object-activity-asset-image) |
| small_text? | string | Text displayed when hovering over the small image of the activity |
| small_url? | string | URL that is opened when clicking on the small image |
| Field | Type | Description |
|---------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| large_image? | string | See [Activity Asset Image](/docs/events/gateway-events#activity-object-activity-asset-image) |
| large_text? | string | Text displayed when hovering over the large image of the activity |
| large_url? | string | URL that is opened when clicking on the large image |
| small_image? | string | See [Activity Asset Image](/docs/events/gateway-events#activity-object-activity-asset-image) |
| small_text? | string | Text displayed when hovering over the small image of the activity |
| small_url? | string | URL that is opened when clicking on the small image |
| 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). |

###### Activity Asset Image

Expand Down