fixed: if discord closed - client not change status to 'false'

This commit is contained in:
AmokDev 2025-03-21 14:56:27 +03:00
parent c959ac4e83
commit 4a7ab5082f
2 changed files with 10 additions and 2 deletions

View file

@ -1,7 +1,7 @@
[package] [package]
name = "rust-discord-rpc" name = "rust-discord-rpc"
description = "A lightweight library to control Discord Rich Presence" description = "A lightweight library to control Discord Rich Presence"
version = "0.3.2" version = "0.3.3"
edition = "2021" edition = "2021"
authors = ["Dylan Cattelan <dylan.cattelan@gmail.com", "AmokDev <amokdevv@gmail.com>"] authors = ["Dylan Cattelan <dylan.cattelan@gmail.com", "AmokDev <amokdevv@gmail.com>"]
license = "MIT" license = "MIT"

View file

@ -60,7 +60,15 @@ impl DiscordClient {
"nonce": uuid::Uuid::new_v4().to_string(), "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 { fn socket(&mut self) -> &mut PipeClient {