From c5b65cb4001e19a0952d89b42de771f860febf41 Mon Sep 17 00:00:00 2001 From: Micah Benac Date: Tue, 25 Feb 2025 16:53:55 +0100 Subject: [PATCH 1/2] fix: small errors and inconsistency in rpc --- docs/topics/RPC.md | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/docs/topics/RPC.md b/docs/topics/RPC.md index db3117e873..b1587212b8 100644 --- a/docs/topics/RPC.md +++ b/docs/topics/RPC.md @@ -111,7 +111,7 @@ Commands are requests made to the RPC socket by a client. | [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 | +| [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. @@ -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" } @@ -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 @@ -1358,9 +1356,9 @@ No arguments | 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) | +| 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 @@ -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 From 2f9ffa1dfe74a1c4fb8ef0dd0e06eb17be655f4b Mon Sep 17 00:00:00 2001 From: Micah Benac Date: Tue, 25 Feb 2025 17:05:03 +0100 Subject: [PATCH 2/2] fix: run the tables script --- docs/topics/RPC.md | 64 +++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/topics/RPC.md b/docs/topics/RPC.md index b1587212b8..1c4fc0693f 100644 --- a/docs/topics/RPC.md +++ b/docs/topics/RPC.md @@ -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_JOIN_REQUEST](#DOCS_TOPICS_RPC/closeactivityjoinrequest) | 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. @@ -1353,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 (`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) | +| 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 @@ -1378,10 +1378,10 @@ No arguments ###### Voice Connection Ping Object -| Field | Type | Description | -|-------------------|------------------|----------------------------------------------------------------------------| -| time | integer | The time the ping was sent | -| value | integer | The latency of the ping (in ms) | +| 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