1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::prelude::*;
use rive_models::voice::VoiceAuthenticationData;

impl Client {
    /// Asks the voice server for a token to join the call
    pub async fn join_call(&self, id: impl Into<String>) -> Result<VoiceAuthenticationData> {
        Ok(self
            .client
            .post(ep!(self, "/channels/{}/join_call", id.into()))
            .auth(&self.authentication)
            .send()
            .await?
            .process_error()
            .await?
            .json()
            .await?)
    }
}