fixed: if discord closed - client not change status to 'false'
This commit is contained in:
parent
c959ac4e83
commit
4a7ab5082f
2 changed files with 10 additions and 2 deletions
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue