diff --git a/src/gateway.rs b/src/gateway.rs index 3e0c4f3..dd0fc28 100644 --- a/src/gateway.rs +++ b/src/gateway.rs @@ -223,6 +223,15 @@ impl GatewayHandle { } } + pub async fn observe_and_get( + &self, + object: Arc>, + ) -> Arc> { + let channel = self.observe(object).await; + let object = channel.borrow().clone(); + object + } + /// Sends an identify event to the gateway pub async fn send_identify(&self, to_send: types::GatewayIdentifyPayload) { let to_send_value = serde_json::to_value(&to_send).unwrap();