Skip to content

Commit

Permalink
Docs: fix ClientConnect to recommend SpeakingStateUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMcFelix committed Feb 13, 2022
1 parent c464fcc commit 652ec1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/serenity/voice_receive/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl VoiceEventHandler for Receiver {
// You can implement your own logic here to handle a user who has left the
// voice channel e.g., finalise processing of statistics etc.
// You will typically need to map the User ID to their SSRC; observed when
// speaking or connecting.
// first speaking.

println!("Client disconnected: user {:?}", user_id);
},
Expand Down
6 changes: 3 additions & 3 deletions src/events/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ pub enum EventContext<'a> {
RtcpPacket(RtcpData<'a>),
#[deprecated(
since = "0.2.2",
note = "ClientConnect events are no longer sent by Discord. Please use SpeakingUpdate or Discord gateway events."
note = "ClientConnect events are no longer sent by Discord. Please use SpeakingStateUpdate or Discord gateway events."
)]
/// Formerly fired whenever a client connects to a call for the first time, allowing SSRC/UserID
/// matching. This event no longer fires.
///
/// To detect when a user connects, you must correlate gateway (e.g., VoiceStateUpdate) events
/// from the main part of your bot.
///
/// To obtain a user's SSRC, you must use [`SpeakingUpdate`] events.
/// To obtain a user's SSRC, you must use [`SpeakingStateUpdate`] events.
///
/// [`SpeakingUpdate`]: Self::SpeakingUpdate
/// [`SpeakingStateUpdate`]: Self::SpeakingStateUpdate
ClientConnect(ClientConnect),
/// Fired whenever a client disconnects.
ClientDisconnect(ClientDisconnect),
Expand Down
6 changes: 3 additions & 3 deletions src/events/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ pub enum CoreEvent {
RtcpPacket,
#[deprecated(
since = "0.2.2",
note = "ClientConnect events are no longer sent by Discord. Please use SpeakingUpdate or Discord gateway events."
note = "ClientConnect events are no longer sent by Discord. Please use SpeakingStateUpdate or Discord gateway events."
)]
/// Formerly fired whenever a client connects to a call for the first time, allowing SSRC/UserID
/// matching. This event no longer fires.
///
/// To detect when a user connects, you must correlate gateway (e.g., VoiceStateUpdate) events
/// from the main part of your bot.
///
/// To obtain a user's SSRC, you must use [`SpeakingUpdate`] events.
/// To obtain a user's SSRC, you must use [`SpeakingStateUpdate`] events.
///
/// [`SpeakingUpdate`]: Self::SpeakingUpdate
/// [`SpeakingStateUpdate`]: Self::SpeakingStateUpdate
ClientConnect,
/// Fires whenever a user disconnects from the same stream as the bot.
ClientDisconnect,
Expand Down

0 comments on commit 652ec1f

Please sign in to comment.