From 284073deeb80cd151d0ea24fd35ce5d767c74fdc Mon Sep 17 00:00:00 2001 From: kozabrada123 <“kozabrada123@users.noreply.github.com”> Date: Thu, 4 May 2023 20:05:33 +0200 Subject: [PATCH] Add WebSocketConnection to Gateway --- src/gateway.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gateway.rs b/src/gateway.rs index 818d14b..d3c6e5f 100644 --- a/src/gateway.rs +++ b/src/gateway.rs @@ -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, tokio_tungstenite::tungstenite::Error> { return Ok(Gateway { - url: websocket_url, + url: websocket_url.clone(), token, events: Events::default(), + websocket: WebSocketConnection::new(websocket_url).await, }); } }