Skip to content

Commit e92babf

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 1b0eee6 + 2e3cf2f commit e92babf

File tree

13 files changed

+226
-89
lines changed

13 files changed

+226
-89
lines changed

docs/developer_tools/Embedded_App_SDK.mdx

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Developers can use these commands to interact with the Discord client. The follo
175175
| [setActivity](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/setactivity) | Modifies how your activity's rich presence is displayed in the Discord client |
176176
| [setConfig](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/setconfig) | Set whether or not the PIP (picture-in-picture) is interactive |
177177
| [setOrientationLockState](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/setorientationlockstate) | Set options for orientation and picture-in-picture (PIP) modes |
178+
| [shareLink](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharelink) | Presents a modal for the user to share a link to your activity with custom query params |
178179
| [startPurchase](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/startpurchase) | Launches the purchase flow for a specific SKU, per the sku_id |
179180
| [userSettingsGetLocale](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/usersettingsgetlocale) | Returns the current user's locale |
180181

@@ -691,6 +692,39 @@ await discordSdk.commands.setOrientationLockState({
691692

692693
---
693694

695+
696+
### shareLink()
697+
698+
Presents the user with a modal to share a link
699+
700+
#### Supported Platforms
701+
| Web | iOS | Android |
702+
|-----|-----|---------|
703+
|| ⛔️ | ⛔️ |
704+
705+
#### Required Scopes
706+
707+
No scopes required
708+
709+
#### Signature
710+
711+
<Monospace>
712+
shareLink(args: [ShareLinkRequest](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharelinkrequest)): Promise\<[ShareLinkResponse](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharelinkresponse)\>\<void\>
713+
</Monospace>
714+
715+
#### Usage
716+
717+
```js
718+
const { success } = await discordSdk.commands.shareLink({
719+
message: 'This message is shared alongside the link!',
720+
referrer_id: 'some_referrer_id',
721+
custom_id: 'some_custom_id',
722+
});
723+
success ? console.log('User shared link!') : console.log('User did not share link!');
724+
```
725+
726+
---
727+
694728
### startPurchase()
695729

696730
Launches the purchase flow for a specific SKU ID.
@@ -759,6 +793,7 @@ Developers may use the following events alongside the `subscribe()` SDK method t
759793
| [ACTIVITY_LAYOUT_MODE_UPDATE](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/activitylayoutmodeupdate) | Received when a user changes the layout mode in the Discord client |
760794
| [ORIENTATION_UPDATE](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/orientationupdate) | Received when screen orientation changes |
761795
| [CURRENT_USER_UPDATE](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/currentuserupdate) | Received when the current user object changes |
796+
| [CURRENT_GUILD_MEMBER_UPDATE](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/currentguildmemberupdate) | Received when the current guild member object changes |
762797
| [THERMAL_STATE_UPDATE](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/thermalstateupdate) | Received when Android or iOS thermal states are surfaced to the Discord app |
763798
| [ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/activityinstanceparticipantsupdate) | Received when the number of instance participants changes |
764799
| [ENTITLEMENT_CREATE](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/entitlementcreate) | Received when an entitlement is created for a SKU |
@@ -943,6 +978,33 @@ Received when the current user object changes.
943978

944979
---
945980

981+
### CURRENT_GUILD_MEMBER_UPDATE
982+
983+
Received when the current guild member object changes.
984+
985+
#### Required Scopes
986+
987+
- identify
988+
- guilds.members.read
989+
990+
#### Sample Event Payload
991+
992+
```javascript
993+
{
994+
"user_id": "7173771622812225536",
995+
"nick": "beef_supreme",
996+
"guild_id": "613425648685547541"
997+
"avatar": "abcdefg",
998+
"avatar_decoration_data": {
999+
"asset": "abcdefg",
1000+
"sku_id": "123456789"
1001+
},
1002+
"color_string": "#ffff00"
1003+
}
1004+
```
1005+
1006+
---
1007+
9461008
### THERMAL_STATE_UPDATE
9471009

9481010
Received when Android or iOS thermal states are surfaced to the Discord mobile app.
@@ -1258,6 +1320,17 @@ No scopes required
12581320
| deaf | boolean |
12591321
| mute | boolean |
12601322

1323+
#### GuildMemberRPC
1324+
1325+
| Property | Type |
1326+
|-------------------------|---------------------------------------------------------------------------------------------|
1327+
| user_id | string |
1328+
| nick? | string \| null |
1329+
| guild_id | string |
1330+
| avatar? | string \| null |
1331+
| avatar_decoration_data? | [AvatarDecorationData](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/avatardecorationdata) \| null |
1332+
| color_string? | string \| null |
1333+
12611334
#### Image
12621335

12631336
| Property | Type |
@@ -1398,6 +1471,20 @@ No scopes required
13981471
| picture_in_picture_lock_state | [OrientationLockState](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/orientationlockstatetypeobject) |
13991472
| grid_lock_state | [OrientationLockState](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/orientationlockstatetypeobject) |
14001473

1474+
#### ShareLinkRequest
1475+
1476+
| Property | Type |
1477+
|-------------|----------------|
1478+
| message | string \| null |
1479+
| referrer_id | string \| null |
1480+
| custom_id | string \| null |
1481+
1482+
#### ShareLinkResponse
1483+
1484+
| Property | Type |
1485+
|----------|---------|
1486+
| success | boolean |
1487+
14011488
#### Sku
14021489

14031490
| Property | Type |
@@ -1604,4 +1691,4 @@ No scopes required
16041691
| DLC | 2 |
16051692
| CONSUMABLE | 3 |
16061693
| BUNDLE | 4 |
1607-
| SUBSCRIPTION | 5 |
1694+
| SUBSCRIPTION | 5 |

docs/interactions/Overview.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ A list of all message components and details on sending and receiving component
4545

4646
### Modals
4747

48-
**[Modals](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/interaction-response-object-modal)** are single-user pop-up interfaces that allow apps to collect form-like data. Modals can only be opened in response to a user invoking on of your app's commands or message components.
48+
**[Modals](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/interaction-response-object-modal)** are single-user pop-up interfaces that allow apps to collect form-like data. Modals can only be opened in response to a user invoking one of your app's commands or message components.
4949

5050
![Modals in the Discord client](overview-modals.png)
5151

@@ -169,4 +169,4 @@ On the **General Overview** page, look for the **Interactive Endpoint URL** fiel
169169

170170
## Handling Interactions
171171

172-
Once your app is prepared for interactions, you can explore the [Receiving and Responding](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING) documentation which goes into the technical details of handling interactions requests in your app.
172+
Once your app is prepared for interactions, you can explore the [Receiving and Responding](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING) documentation which goes into the technical details of handling interactions requests in your app.

docs/quick_start/Getting_Started.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,10 @@ const componentId = data.custom_id;
502502
// Get user ID and object choice for responding user
503503
// User ID is in user field for (G)DMs, and member for servers
504504
const userId = context === 0 ? req.body.member.user.id : req.body.user.id;
505+
506+
// User's object choice
507+
const objectName = data.values[0];
508+
505509
// Calculate result from helper function
506510
const resultStr = getResult(activeGames[gameId], {
507511
id: userId,

docs/quick_start/Overview_of_Apps.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ With the right API endpoints and proper [permissions](#DOCS_TOPICS_PERMISSIONS),
3838

3939
### Update user metadata and presence
4040

41-
Apps can update a Discord's user metadata with data from a party game or app in a few ways.Apps can also update a user's profile with actionable data from a game or app by integrating **[Rich Presence](#DOCS_RICH_PRESENCE_OVERVIEW)**. Apps can also use **[role connection metadata](#DOCS_RESOURCES_APPLICATION_ROLE_CONNECTION_METADATA)** to associate third-party metadata (like stats or account type) with Discord users, which server admins can use to set up roles based on. You can explore more in the [configuring metadata for linked roles](#DOCS_TUTORIALS_CONFIGURING_APP_METADATA_FOR_LINKED_ROLES) tutorial.
41+
Apps can update a Discord's user metadata with data from a party game or app in a few ways. Apps can also update a user's profile with actionable data from a game or app by integrating **[Rich Presence](#DOCS_RICH_PRESENCE_OVERVIEW)**. Apps can also use **[role connection metadata](#DOCS_RESOURCES_APPLICATION_ROLE_CONNECTION_METADATA)** to associate third-party metadata (like stats or account type) with Discord users, which server admins can use to set up roles based on. You can explore more in the [configuring metadata for linked roles](#DOCS_TUTORIALS_CONFIGURING_APP_METADATA_FOR_LINKED_ROLES) tutorial.
4242

4343
### Add premium features
4444

docs/resources/Audit_Log.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The table below lists audit log events and values (the `action_type` field) that
7171

7272
The **Object Changed** column notes which object's values may be included in the entry. Though there are exceptions, possible keys in the `changes` array typically correspond to the object's fields. The descriptions and types for those fields can be found in the linked documentation for the object.
7373

74-
If no object is noted, there won't be a `changes` array in the entry, though other fields like the `target_id` still exist and many have fields in the [`options` array](#DOCS_RESOURCES_AUDIT_LOG/audit-log-entry-object-optional-audit-entry-info).
74+
If no object is noted, there won't be a `changes` array in the entry, though other fields like the `target_id` still exist and many have fields in the [`options` object](#DOCS_RESOURCES_AUDIT_LOG/audit-log-entry-object-optional-audit-entry-info).
7575

7676
> info
7777
> You should assume that your app may run into any field for the changed object, though none are guaranteed to be present. In most cases only a subset of the object's fields will be in the `changes` array.

0 commit comments

Comments
 (0)