Skip to content

Commit 0390fad

Browse files
committed
Document SDK relationship command + event
1 parent 76762eb commit 0390fad

File tree

1 file changed

+74
-1
lines changed

1 file changed

+74
-1
lines changed

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

Lines changed: 74 additions & 1 deletion
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,35 @@ 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+
#### Signature
475+
476+
<Monospace>
477+
getRelationships(): Promise\<[GetRelationshipsResponse](/docs/developer-tools/embedded-app-sdk#getrelationshipsresponse)\>
478+
</Monospace>
479+
480+
#### Usage
481+
482+
```js
483+
await discordSdk.commands.getRelationships();
484+
```
485+
486+
---
487+
458488
### getSkus()
459489

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

800-
801831
### READY
802832

803833
Non-subscription event sent immediately after connecting, contains server information.
@@ -1051,6 +1081,36 @@ No scopes required
10511081
]
10521082
}
10531083
```
1084+
---
1085+
1086+
### RELATIONSHIP_UPDATE
1087+
1088+
Received when a relationship of the current user is updated.
1089+
1090+
#### Required Scopes
1091+
1092+
- relationships.read
1093+
1094+
#### Sample Event Payload
1095+
```javascript
1096+
{
1097+
"type": 1,
1098+
"user": {
1099+
"id": "7173771622812225536",
1100+
"username": "beef_supreme",
1101+
"discriminator": "0",
1102+
"global_name": "Dis Cord",
1103+
"avatar": "abcdefg",
1104+
"avatar_decoration_data": {
1105+
"asset": "abcdefg",
1106+
"sku_id": "123456789"
1107+
},
1108+
"bot": false,
1109+
"flags": 1,
1110+
"premium_type": 2
1111+
}
1112+
}
1113+
```
10541114

10551115
---
10561116

@@ -1302,6 +1362,12 @@ Coming soon! Not available during Developer Preview
13021362
|-------------------------|---------|
13031363
| iosKeyboardResizesView? | boolean |
13041364

1365+
#### GetRelationshipsResponse
1366+
1367+
| Property | Type |
1368+
|---------------|-----------------------------------------------------------------------|
1369+
| relationships | [Relationship](/docs/developer-tools/embedded-app-sdk#relationship)[] |
1370+
13051371
#### GetSkusResponse
13061372

13071373
| Property | Type |
@@ -1438,6 +1504,13 @@ Coming soon! Not available during Developer Preview
14381504
| me | boolean |
14391505
| emoji | [Emoji](/docs/developer-tools/embedded-app-sdk#emoji) |
14401506

1507+
#### Relationship
1508+
1509+
| Property | Type |
1510+
|----------|--------|
1511+
| type | number |
1512+
| user | [User](/docs/developer-tools/embedded-app-sdk#user) |
1513+
14411514
#### Secrets
14421515

14431516
| Property | Type |

0 commit comments

Comments
 (0)