Skip to content

fix: small errors and inconsistency in rpc #7406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 39 additions & 34 deletions docs/topics/RPC.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,27 @@ Commands are requests made to the RPC socket by a client.

###### RPC Commands

| Name | Description |
|------------------------------------------------------------------------|-----------------------------------------------------------------|
| [DISPATCH](#DOCS_TOPICS_RPC/commands-and-events-rpc-events) | event dispatch |
| [AUTHORIZE](#DOCS_TOPICS_RPC/authorize) | used to authorize a new client with your app |
| [AUTHENTICATE](#DOCS_TOPICS_RPC/authenticate) | used to authenticate an existing client with your app |
| [GET_GUILD](#DOCS_TOPICS_RPC/getguild) | used to retrieve guild information from the client |
| [GET_GUILDS](#DOCS_TOPICS_RPC/getguilds) | used to retrieve a list of guilds from the client |
| [GET_CHANNEL](#DOCS_TOPICS_RPC/getchannel) | used to retrieve channel information from the client |
| [GET_CHANNELS](#DOCS_TOPICS_RPC/getchannels) | used to retrieve a list of channels for a guild from the client |
| [SUBSCRIBE](#DOCS_TOPICS_RPC/subscribe) | used to subscribe to an RPC event |
| [UNSUBSCRIBE](#DOCS_TOPICS_RPC/unsubscribe) | used to unsubscribe from an RPC event |
| [SET_USER_VOICE_SETTINGS](#DOCS_TOPICS_RPC/setuservoicesettings) | used to change voice settings of users in voice channels |
| [SELECT_VOICE_CHANNEL](#DOCS_TOPICS_RPC/selectvoicechannel) | used to join or leave a voice channel, group dm, or dm |
| [GET_SELECTED_VOICE_CHANNEL](#DOCS_TOPICS_RPC/getselectedvoicechannel) | used to get the current voice channel the client is in |
| [SELECT_TEXT_CHANNEL](#DOCS_TOPICS_RPC/selecttextchannel) | used to join or leave a text channel, group dm, or dm |
| [GET_VOICE_SETTINGS](#DOCS_TOPICS_RPC/getvoicesettings) | used to retrieve the client's voice settings |
| [SET_VOICE_SETTINGS](#DOCS_TOPICS_RPC/setvoicesettings) | used to set the client's voice settings |
| [SET_CERTIFIED_DEVICES](#DOCS_TOPICS_RPC/setcertifieddevices) | used to send info about certified hardware devices |
| [SET_ACTIVITY](#DOCS_TOPICS_RPC/setactivity) | used to update a user's Rich Presence |
| [SEND_ACTIVITY_JOIN_INVITE](#DOCS_TOPICS_RPC/sendactivityjoininvite) | used to consent to a Rich Presence Ask to Join request |
| [CLOSE_ACTIVITY_REQUEST](#DOCS_TOPICS_RPC/closeactivityrequest) | used to reject a Rich Presence Ask to Join request |
| Name | Description |
|--------------------------------------------------------------------------|-----------------------------------------------------------------|
| [DISPATCH](#DOCS_TOPICS_RPC/commands-and-events-rpc-events) | event dispatch |
| [AUTHORIZE](#DOCS_TOPICS_RPC/authorize) | used to authorize a new client with your app |
| [AUTHENTICATE](#DOCS_TOPICS_RPC/authenticate) | used to authenticate an existing client with your app |
| [GET_GUILD](#DOCS_TOPICS_RPC/getguild) | used to retrieve guild information from the client |
| [GET_GUILDS](#DOCS_TOPICS_RPC/getguilds) | used to retrieve a list of guilds from the client |
| [GET_CHANNEL](#DOCS_TOPICS_RPC/getchannel) | used to retrieve channel information from the client |
| [GET_CHANNELS](#DOCS_TOPICS_RPC/getchannels) | used to retrieve a list of channels for a guild from the client |
| [SUBSCRIBE](#DOCS_TOPICS_RPC/subscribe) | used to subscribe to an RPC event |
| [UNSUBSCRIBE](#DOCS_TOPICS_RPC/unsubscribe) | used to unsubscribe from an RPC event |
| [SET_USER_VOICE_SETTINGS](#DOCS_TOPICS_RPC/setuservoicesettings) | used to change voice settings of users in voice channels |
| [SELECT_VOICE_CHANNEL](#DOCS_TOPICS_RPC/selectvoicechannel) | used to join or leave a voice channel, group dm, or dm |
| [GET_SELECTED_VOICE_CHANNEL](#DOCS_TOPICS_RPC/getselectedvoicechannel) | used to get the current voice channel the client is in |
| [SELECT_TEXT_CHANNEL](#DOCS_TOPICS_RPC/selecttextchannel) | used to join or leave a text channel, group dm, or dm |
| [GET_VOICE_SETTINGS](#DOCS_TOPICS_RPC/getvoicesettings) | used to retrieve the client's voice settings |
| [SET_VOICE_SETTINGS](#DOCS_TOPICS_RPC/setvoicesettings) | used to set the client's voice settings |
| [SET_CERTIFIED_DEVICES](#DOCS_TOPICS_RPC/setcertifieddevices) | used to send info about certified hardware devices |
| [SET_ACTIVITY](#DOCS_TOPICS_RPC/setactivity) | used to update a user's Rich Presence |
| [SEND_ACTIVITY_JOIN_INVITE](#DOCS_TOPICS_RPC/sendactivityjoininvite) | used to consent to a Rich Presence Ask to Join request |
| [CLOSE_ACTIVITY_JOIN_REQUEST](#DOCS_TOPICS_RPC/closeactivityjoinrequest) | used to reject a Rich Presence Ask to Join request |

Events are payloads sent over the socket to a client that correspond to events in Discord.

Expand Down Expand Up @@ -1058,22 +1058,22 @@ Used to accept an Ask to Join request.
}
```

#### CLOSE_ACTIVITY_REQUEST
#### CLOSE_ACTIVITY_JOIN_REQUEST

Used to reject an Ask to Join request.

###### Close Activity Request Argument Structure
###### Close Activity Join Request Argument Structure

| Field | Type | Description |
|---------|-----------|-------------------------------|
| user_id | snowflake | the id of the requesting user |

###### Example Close Activity Request Payload
###### Example Close Activity Join Request Payload

```json
{
"nonce": "5dc0c062-98c6-47a0-8922-15aerg126",
"cmd": "CLOSE_ACTIVITY_REQUEST",
"cmd": "CLOSE_ACTIVITY_JOIN_REQUEST",
"args": {
"user_id": "53908232506183680"
}
Expand Down Expand Up @@ -1252,8 +1252,6 @@ No arguments

#### VOICE_SETTINGS_UPDATE

###### Voice Settings Argument Structure

No arguments. Dispatches the [Get Voice Settings](#DOCS_TOPICS_RPC/getvoicesettings) response.

###### Example Voice Settings Dispatch Payload
Expand Down Expand Up @@ -1355,13 +1353,13 @@ No arguments

###### Voice Connection Status Dispatch Data Structure

| Field | Type | Description |
|--------------|-------------------|-------------------------------------------------|
| state | string | one of the voice connection states listed below |
| hostname | string | hostname of the connected voice server |
| pings | array of integers | last 20 pings (in ms) |
| average_ping | integer | average ping (in ms) |
| last_ping | integer | last ping (in ms) |
| Field | Type | Description |
|--------------|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| state | string | one of the voice connection states listed below |
| hostname | string | hostname of the connected voice server (`null` if state is `AWAITING_ENDPOINT`) |
| pings | array of [ping](#DOCS_TOPICS_RPC/voiceconnectionstatus-voice-connection-ping-object) objects | all accumulated pings since voice join |
| average_ping | float | average ping (in ms) |
| last_ping | integer | last ping (in ms) |

###### Voice Connection States

Expand All @@ -1378,6 +1376,13 @@ No arguments
| NO_ROUTE | No route to host |
| ICE_CHECKING | WebRTC ice checking |

###### Voice Connection Ping Object

| Field | Type | Description |
|-------|---------|---------------------------------|
| time | integer | The time the ping was sent |
| value | integer | The latency of the ping (in ms) |

###### Example Voice Connection Status Dispatch Payload

```json
Expand Down