You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(rpc): add reference documentation for new IPC events
Add anchor links and full dispatch data structure documentation for
ACTIVITY_INVITE, CURRENT_USER_UPDATE, RELATIONSHIP_UPDATE,
ENTITLEMENT_CREATE, and ENTITLEMENT_DELETE, which were added to the
RPC Events table without reference sections.
Also did some minor cleanup of text, and linked to the Social SDK.
Continuation of work in #8246
Copy file name to clipboardExpand all lines: developers/topics/rpc.mdx
+258-7Lines changed: 258 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,11 @@ import {ManualAnchor} from '/snippets/manualanchor.jsx'
8
8
9
9
## RPC over IPC
10
10
11
-
Discord's RPC server supports IPC (Inter-Process Communication) as the primary transport for native applications and games. This allows high-performance, local communication with the Discord client without requiring network-level overhead.
11
+
Discord's RPC server supports IPC (Inter-Process Communication) as transport for native applications and games. This allows high-performance, local communication with the Discord client without requiring network-level overhead.
12
+
13
+
<Warning>
14
+
We recommend using the [Discord Social SDK](/developers/discord-social-sdk/overview) for new projects that are looking to integrate Discord's social features into their game.
15
+
</Warning>
12
16
13
17
###### IPC Path
14
18
@@ -113,7 +117,7 @@ For applications/games not approved, we limit you to creating 10 guilds and 10 c
113
117
114
118
## Authenticating
115
119
116
-
In order to call any commands over RPC, you must be authenticated or you will receive a code `4006` error response. Thankfully, we've removed the oppressive nature of a couple commands that will let you `AUTHORIZE` and `AUTHENTICATE` new users. First, call [AUTHORIZE](/developers/topics/rpc#authorize):
120
+
In order to call any commands over RPC, you must be authenticated or you will receive a code `4006` error response. To begin, call [AUTHORIZE](/developers/topics/rpc#authorize):
|[READY](/developers/topics/rpc#ready-ready-dispatch-data-structure)| non-subscription event sent immediately after connecting, contains server information |
186
190
|[ERROR](/developers/topics/rpc#error-error-data-structure)| non-subscription event sent when there is an error, including command responses |
187
-
| CURRENT_USER_UPDATE| sent when the local user's data (avatar, username, etc.) changes |
188
-
| RELATIONSHIP_UPDATE| sent when a relationship (friend, block, etc.) is added or removed |
191
+
|[CURRENT_USER_UPDATE](/developers/topics/rpc#currentuserupdate)| sent when the local user's data (avatar, username, etc.) changes |
192
+
|[RELATIONSHIP_UPDATE](/developers/topics/rpc#relationshipupdate)| sent when a relationship (friend, block, etc.) is added or removed |
189
193
|[GUILD_STATUS](/developers/topics/rpc#guildstatus)| sent when a subscribed server's state changes |
190
194
|[GUILD_CREATE](/developers/topics/rpc#guildcreate)| sent when a guild is created/joined on the client |
191
195
|[CHANNEL_CREATE](/developers/topics/rpc#channelcreate)| sent when a channel is created/joined on the client |
@@ -204,9 +208,9 @@ Events are payloads sent over the socket to a client that correspond to events i
204
208
|[ACTIVITY_JOIN](/developers/topics/rpc#activityjoin)| sent when the user clicks a Rich Presence join invite in chat to join a game |
205
209
|[ACTIVITY_SPECTATE](/developers/topics/rpc#activityspectate)| sent when the user clicks a Rich Presence spectate invite in chat to spectate a game |
206
210
|[ACTIVITY_JOIN_REQUEST](/developers/topics/rpc#activityjoinrequest)| sent when the user receives a Rich Presence Ask to Join request |
207
-
| ACTIVITY_INVITE| sent when the user receives an activity invitation |
208
-
| ENTITLEMENT_CREATE| sent when a user purchases or receives a new entitlement (SKU/Game) |
209
-
| ENTITLEMENT_DELETE| sent when an entitlement is removed |
211
+
|[ACTIVITY_INVITE](/developers/topics/rpc#activityinvite)| sent when the user receives an activity invitation |
212
+
|[ENTITLEMENT_CREATE](/developers/topics/rpc#entitlementcreate)| sent when a user purchases or receives a new entitlement (SKU/Game) |
213
+
|[ENTITLEMENT_DELETE](/developers/topics/rpc#entitlementdelete)| sent when an entitlement is removed |
###### Example Entitlement Create Dispatch Payload
1988
+
1989
+
```json
1990
+
{
1991
+
"cmd": "DISPATCH",
1992
+
"data": {
1993
+
"entitlement": {
1994
+
"id": "1019653849998299136",
1995
+
"sku_id": "1019475255913222144",
1996
+
"application_id": "192741864418312192",
1997
+
"user_id": "53908232506183680",
1998
+
"type": 8,
1999
+
"deleted": false,
2000
+
"starts_at": "2022-09-14T17:00:18.704163+00:00",
2001
+
"ends_at": "2022-10-14T17:00:18.704163+00:00"
2002
+
}
2003
+
},
2004
+
"evt": "ENTITLEMENT_CREATE"
2005
+
}
2006
+
```
2007
+
2008
+
<ManualAnchorid="entitlementdelete" />
2009
+
#### ENTITLEMENT_DELETE
2010
+
2011
+
No arguments. Fired when an entitlement for this application is removed. The entitlement object in the payload reflects the state of the entitlement at the time of deletion.
0 commit comments