Add WebSocketConnection to Gateway
This commit is contained in:
parent
eb98f1374c
commit
f5502a8121
|
@ -34,6 +34,7 @@ pub struct Gateway<'a> {
|
||||||
pub url: String,
|
pub url: String,
|
||||||
pub token: String,
|
pub token: String,
|
||||||
pub events: Events<'a>,
|
pub events: Events<'a>,
|
||||||
|
websocket: WebSocketConnection,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Gateway<'a> {
|
impl<'a> Gateway<'a> {
|
||||||
|
@ -42,9 +43,10 @@ impl<'a> Gateway<'a> {
|
||||||
token: String,
|
token: String,
|
||||||
) -> Result<Gateway<'a>, tokio_tungstenite::tungstenite::Error> {
|
) -> Result<Gateway<'a>, tokio_tungstenite::tungstenite::Error> {
|
||||||
return Ok(Gateway {
|
return Ok(Gateway {
|
||||||
url: websocket_url,
|
url: websocket_url.clone(),
|
||||||
token,
|
token,
|
||||||
events: Events::default(),
|
events: Events::default(),
|
||||||
|
websocket: WebSocketConnection::new(websocket_url).await,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue