Skip to content

Commit ef5e0d0

Browse files
authored
Update Embedded App SDK docs with relationship features (#7547)
* Address feedback * cleanup * format
1 parent aa2967d commit ef5e0d0

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

docs/developer-tools/embedded-app-sdk.mdx

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ Developers can use these commands to interact with the Discord client. The follo
167167
| [getEntitlements](/docs/developer-tools/embedded-app-sdk#getentitlements) | Returns a list of entitlements for the current user |
168168
| [getInstanceConnectedParticipants](/docs/developer-tools/embedded-app-sdk#getinstanceconnectedparticipants) | Returns all participants connected to the instance |
169169
| [getPlatformBehaviors](/docs/developer-tools/embedded-app-sdk#getplatformbehaviors) | Returns information about supported platform behaviors |
170+
| [getRelationships](/docs/developer-tools/embedded-app-sdk#getrelationships) | Returns the current user's relationships |
170171
| [getSkus](/docs/developer-tools/embedded-app-sdk#getskus) | Returns a list of your app's SKUs |
171172
| [initiateImageUpload](/docs/developer-tools/embedded-app-sdk#initiateimageupload) | Presents the file upload flow in the Discord client |
172173
| [openExternalLink](/docs/developer-tools/embedded-app-sdk#openexternallink) | Allows for opening an external link from within the Discord client |
@@ -455,6 +456,39 @@ await discordSdk.commands.getPlatformBehaviors();
455456

456457
---
457458

459+
460+
### getRelationships()
461+
462+
Returns the current user's relationships.
463+
464+
465+
#### Supported Platforms
466+
| Web | iOS | Android |
467+
|-----|-----|---------|
468+
||||
469+
470+
#### Required Scopes
471+
472+
- relationships.read
473+
474+
:::info
475+
Requires Discord approval
476+
:::
477+
478+
#### Signature
479+
480+
<Monospace>
481+
getRelationships(): Promise\<[GetRelationshipsResponse](/docs/developer-tools/embedded-app-sdk#getrelationshipsresponse)\>
482+
</Monospace>
483+
484+
#### Usage
485+
486+
```js
487+
await discordSdk.commands.getRelationships();
488+
```
489+
490+
---
491+
458492
### getSkus()
459493

460494
Returns a list of SKU objects. SKUs without prices are automatically filtered out.
@@ -795,6 +829,7 @@ Developers may use the following events alongside the `subscribe()` SDK method t
795829
| [CURRENT_GUILD_MEMBER_UPDATE](/docs/developer-tools/embedded-app-sdk#currentguildmemberupdate) | Received when the current guild member object changes |
796830
| [THERMAL_STATE_UPDATE](/docs/developer-tools/embedded-app-sdk#thermalstateupdate) | Received when Android or iOS thermal states are surfaced to the Discord app |
797831
| [ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE](/docs/developer-tools/embedded-app-sdk#activityinstanceparticipantsupdate) | Received when the number of instance participants changes |
832+
| [RELATIONSHIP_UPDATE](/docs/developer-tools/embedded-app-sdk#relationshipupdate) | Received when a relationship of the current user is updated |
798833
| [ENTITLEMENT_CREATE](/docs/developer-tools/embedded-app-sdk#entitlementcreate) | Received when an entitlement is created for a SKU |
799834

800835

@@ -1054,6 +1089,41 @@ No scopes required
10541089

10551090
---
10561091

1092+
### RELATIONSHIP_UPDATE
1093+
1094+
Received when a relationship of the current user is updated.
1095+
1096+
#### Required Scopes
1097+
1098+
- relationships.read
1099+
1100+
:::info
1101+
Requires Discord approval
1102+
:::
1103+
1104+
#### Sample Event Payload
1105+
```javascript
1106+
{
1107+
"type": 1,
1108+
"user": {
1109+
"id": "7173771622812225536",
1110+
"username": "beef_supreme",
1111+
"discriminator": "0",
1112+
"global_name": "Dis Cord",
1113+
"avatar": "abcdefg",
1114+
"avatar_decoration_data": {
1115+
"asset": "abcdefg",
1116+
"sku_id": "123456789"
1117+
},
1118+
"bot": false,
1119+
"flags": 1,
1120+
"premium_type": 2
1121+
}
1122+
}
1123+
```
1124+
1125+
---
1126+
10571127
### ENTITLEMENT_CREATE
10581128

10591129
:::preview
@@ -1302,6 +1372,12 @@ Coming soon! Not available during Developer Preview
13021372
|-------------------------|---------|
13031373
| iosKeyboardResizesView? | boolean |
13041374

1375+
#### GetRelationshipsResponse
1376+
1377+
| Property | Type |
1378+
|---------------|-----------------------------------------------------------------------|
1379+
| relationships | [Relationship](/docs/developer-tools/embedded-app-sdk#relationship)[] |
1380+
13051381
#### GetSkusResponse
13061382

13071383
| Property | Type |
@@ -1438,6 +1514,13 @@ Coming soon! Not available during Developer Preview
14381514
| me | boolean |
14391515
| emoji | [Emoji](/docs/developer-tools/embedded-app-sdk#emoji) |
14401516

1517+
#### Relationship
1518+
1519+
| Property | Type |
1520+
|----------|---------------------------------------------------------------------|
1521+
| type | [number](/docs/developer-tools/embedded-app-sdk#relationship-types) |
1522+
| user | [User](/docs/developer-tools/embedded-app-sdk#user) |
1523+
14411524
#### Secrets
14421525

14431526
| Property | Type |
@@ -1690,3 +1773,15 @@ Coming soon! Not available during Developer Preview
16901773
| CONSUMABLE | 3 |
16911774
| BUNDLE | 4 |
16921775
| SUBSCRIPTION | 5 |
1776+
1777+
#### Relationship Types
1778+
1779+
| Value | Name | Description |
1780+
|-------|------------------|--------------------------------------------------------------------------------------------------|
1781+
| 0 | None | The user has no relationship with the other user. |
1782+
| 1 | Friend | The user is friends with the other user. |
1783+
| 2 | Blocked | The current user has blocked the target user. |
1784+
| 3 | Pending Incoming | The current user has received a friend request from the target user, but it is not yet accepted. |
1785+
| 4 | Pending Outgoing | The current user has sent a friend request to the target user, but it is not yet accepted. |
1786+
| 5 | Implicit | The Implicit type is documented for visibility, but should be unused in the SDK. |
1787+
| 6 | Suggestion | The Suggestion type is documented for visibility, but should be unused in the SDK. |

0 commit comments

Comments
 (0)