Struct discord::Connection 
                   
                       [−]
                   
               [src]
pub struct Connection {
    // some fields omitted
}Websocket connection to the Discord servers.
Methods
impl Connection[src]
fn new(base_url: &str, token: &str) -> Result<(Connection, ReadyEvent)>
Establish a connection to the Discord websocket servers.
Returns both the Connection and the ReadyEvent which is always the
first event received and contains initial state information.
Usually called internally by Discord::connect, which provides both
the token and URL.
fn set_game(&self, game: Option<Game>)
Change the game information that this client reports as playing.
fn set_game_name(&self, name: String)
Set the client to be playing this game, with defaults used for any extended information.
fn voice(&mut self, server_id: ServerId) -> &mut VoiceConnection
Get a handle to the voice connection for a server.
fn drop_voice(&mut self, server_id: ServerId)
Drop the voice connection for a server, forgetting all settings.
Calling .voice(server_id).disconnect() will disconnect from voice but retain the mute
and deaf status, audio source, and audio receiver.
fn recv_event(&mut self) -> Result<Event>
Receive an event over the websocket, blocking until one is available.
fn shutdown(self) -> Result<()>
Cleanly shut down the websocket connection. Optional.