diff --git a/Cargo.toml b/Cargo.toml index f2e9193..7e40b49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rust-discord-rpc" description = "A lightweight library to control Discord Rich Presence" -version = "0.3.2" +version = "0.3.3" edition = "2021" authors = ["Dylan Cattelan "] license = "MIT" diff --git a/src/client/ipc.rs b/src/client/ipc.rs index 936c723..4fc75ef 100644 --- a/src/client/ipc.rs +++ b/src/client/ipc.rs @@ -60,7 +60,15 @@ impl DiscordClient { "nonce": uuid::Uuid::new_v4().to_string(), }); - Ok(self.send(payload, OpCode::MESSAGE as u8)?) + match self.send(payload, OpCode::MESSAGE as u8) { + Ok(retval) => { + Ok(retval) + }, + Err(e) => { + self.is_connected = false; + Err(e) + }, + } } fn socket(&mut self) -> &mut PipeClient {