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
Copy file name to clipboardExpand all lines: docs/topics/Rich_Presence.md
+14-8Lines changed: 14 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -134,7 +134,12 @@ When you send the relevant payload data in the `Discord_UpdatePresence()` call,
134
134
135
135
Other Discord users can click "Join" on the invitation. Their game will then launch, and the `joinGame()` callback will fire in their client with the inviting player's `joinSecret`. The client should reverse hash or otherwise unencrypt this secret and match the players together.
136
136
137
-
To enable the Ask to Join button on your players' profiles, you'll need to be whitelisted by us—send an email to [gamedevs@discordapp.com](mailto:gamedevs@discordapp.com) to request access. Once whitelisted, you'll have access to the `joinRequest()` callback which sends the following data:
137
+
### Ask to Join
138
+
139
+
>warn
140
+
>To enable the Ask to Join button on your players' profiles, you'll need to be whitelisted by us—send an email to [gamedevs@discordapp.com](mailto:gamedevs@discordapp.com) to request access. Once whitelisted, you'll see the button.
141
+
142
+
When Player B clicks the Ask to Join button on Player A's profile, the `joinRequest()` callback fires for Player A, sending the following data:
138
143
139
144
###### Ask to Join Payload
140
145
@@ -144,10 +149,13 @@ To enable the Ask to Join button on your players' profiles, you'll need to be wh
144
149
| username | char* | the username of the player asking to join |
145
150
| avatarUrl | char* | the url from which the avatar of the player asking to join can be retrieved |
146
151
147
-
When it fires, your game should surface this data with a Yes or No choice for the player to accept whether or not they wish to play with the other user. If no, return false. If yes, return true and the `userId` from the request.
152
+
When it fires, your game should surface this data with a Yes or No choice for Player A to accept whether or not they wish to play with Player B. If no, return `false`. If yes, return `true` and Player B's `userId` from the request.
148
153
149
154
## Spectating
150
155
156
+
>warn
157
+
>To enable the Spectate button on your players' profiles, you'll need to be whitelisted by us—send an email to [gamedevs@discordapp.com](mailto:gamedevs@discordapp.com) to request access. Once whitelisted the profile button will appear.
158
+
151
159
Relevant Callbacks:
152
160
153
161
- `spectateGame()`
@@ -159,9 +167,7 @@ Relevant Payload Data:
159
167
160
168
When you send the relevant payload data in the `Discord_UpdatePresence()` call, your player will gain the ability to invite a Discord chat channel to spectate their game. This invite is tied to the `matchSecret` and will expire when it changes.
161
169
162
-
Other Discord users can click "Spectate" on the invitation. Their game will launch, and the `spectateGame()` callback will fire in their client with the inviting player's `spectateSecret`. The client should reverse hash or otherwise unencrypt this secret and spectate the player's game.
163
-
164
-
To enable the Spectate button on your players' profiles, you'll need to be whitelisted by us—send an email to [gamedevs@discordapp.com](mailto:gamedevs@discordapp.com) to request access. Once whitelisted, you'll have access to the `spectateGame()` callback, and the profile button will appear.
170
+
Other Discord users can click "Spectate" on the invitation. Their game will launch, and the `spectateGame()` callback will fire in their client with the original player's `spectateSecret`. The client should reverse hash or otherwise unencrypt this secret and spectate that player's game.
165
171
166
172
## Secrets
167
173
@@ -188,8 +194,8 @@ All fields in the `DiscordRichPresence` object are entirely optional. Anything y
188
194
| largeImageText | x | | | | |
189
195
| smallImageText | x | | | | |
190
196
| partyId | | | | x | x |
191
-
| partySize | | | | | |
192
-
| partyMax | | | | | |
197
+
| partySize | | | | x | x |
198
+
| partyMax | | | | x | x |
193
199
| matchSecret | | x | | | |
194
200
| joinSecret | | | | x | x |
195
201
| spectateSecret | | | x | | |
@@ -202,7 +208,7 @@ Included with the launch of Rich Presence is an overhaul of Discord's Developer
202
208
OK, well, not entirely. But! Discord _will_ host any and all artwork that you need to have the very richest of presences. Upload an image, tag it with a key—preferrably one you can remember—and **bam**. It's ready for Rich Presence use. Head over to your [applications page](#MY_APPLICATIONS/top) to check it out!
203
209
204
210
>warn
205
-
>Asset keys are automatically stored as **all lowercase** strings. Be mindful of this when referring to them in your code.
211
+
>**Asset keys are automatically normalized to lowercase**. Be mindful of this when referring to them in your code.
0 commit comments