Add WebSocketConnection to Gateway

This commit is contained in:
kozabrada123 2023-05-04 20:05:33 +02:00
parent a8e3ad0950
commit 284073deeb
1 changed files with 3 additions and 1 deletions

View File

@ -34,6 +34,7 @@ pub struct Gateway<'a> {
pub url: String,
pub token: String,
pub events: Events<'a>,
websocket: WebSocketConnection,
}
impl<'a> Gateway<'a> {
@ -42,9 +43,10 @@ impl<'a> Gateway<'a> {
token: String,
) -> Result<Gateway<'a>, tokio_tungstenite::tungstenite::Error> {
return Ok(Gateway {
url: websocket_url,
url: websocket_url.clone(),
token,
events: Events::default(),
websocket: WebSocketConnection::new(websocket_url).await,
});
}
}