Events: Deprecate ClientConnect (#112)

Discord no longer send these websocket payloads, users should instead rely on the main part of their bot for determining actual connection events, or `SpeakingUpdate`s for SSRC mapping.

Closes #104.
This commit is contained in:
Kyle Simpson
2022-02-13 12:06:50 +00:00
committed by GitHub
parent 2feadc761e
commit c464fcc38d
3 changed files with 30 additions and 23 deletions

View File

@@ -25,7 +25,19 @@ pub enum CoreEvent {
/// Fires on receipt of an RTCP packet, containing various call stats
/// such as latency reports.
RtcpPacket,
/// Fires whenever a user connects to the same stream as the bot.
#[deprecated(
since = "0.2.2",
note = "ClientConnect events are no longer sent by Discord. Please use SpeakingUpdate 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.
///
/// [`SpeakingUpdate`]: Self::SpeakingUpdate
ClientConnect,
/// Fires whenever a user disconnects from the same stream as the bot.
ClientDisconnect,