Skip to content

Commit 17e5cf0

Browse files
committed
Address feedback
1 parent 76762eb commit 17e5cf0

File tree

1 file changed

+95
-1
lines changed

1 file changed

+95
-1
lines changed

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

Lines changed: 95 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,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,9 +829,9 @@ 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

800-
801835
### READY
802836

803837
Non-subscription event sent immediately after connecting, contains server information.
@@ -1054,6 +1088,41 @@ No scopes required
10541088

10551089
---
10561090

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

10591128
:::preview
@@ -1302,6 +1371,12 @@ Coming soon! Not available during Developer Preview
13021371
|-------------------------|---------|
13031372
| iosKeyboardResizesView? | boolean |
13041373

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

13071382
| Property | Type |
@@ -1438,6 +1513,13 @@ Coming soon! Not available during Developer Preview
14381513
| me | boolean |
14391514
| emoji | [Emoji](/docs/developer-tools/embedded-app-sdk#emoji) |
14401515

1516+
#### Relationship
1517+
1518+
| Property | Type |
1519+
|----------|---------------------------------------------------------------------------------|
1520+
| type | [Relationship Types](/docs/developer-tools/embedded-app-sdk#relationship-types) |
1521+
| user | [User](/docs/developer-tools/embedded-app-sdk#user) |
1522+
14411523
#### Secrets
14421524

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

0 commit comments

Comments
 (0)