Skip to content

Commit

Permalink
Updated dependencies, use crate to clear activity
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayrsn committed Sep 17, 2022
1 parent 96410e8 commit 32dc5bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "discord-rpc-cli"
version = "1.4.2"
version = "1.4.3"
edition = "2021"
authors = ["Rayr <https://rayr.ml/LinkInBio>"]
description = "A Discord RPC cli client written purely in Rust"
Expand All @@ -12,9 +12,7 @@ keywords = ["discord", "rich-presence", "cli", "rpc"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
discord-rich-presence = "0.2.2"
discord-rich-presence = "0.2.3"
clap = { version = "3.0.14", features = ["derive"] }
colored = "2.0.0"
user-idle = "0.5.1"
serde_json = "1.0"
uuid = { version = "0.8", features = ["v4"] }
13 changes: 1 addition & 12 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ use clap::StructOpt;
use discord_rich_presence::{activity::{self, Activity,Party,Secrets}, DiscordIpcClient, DiscordIpc};
use colored::*;
use user_idle::UserIdle;
use uuid::Uuid;
use serde_json::json;


mod cli;

Expand Down Expand Up @@ -287,15 +284,7 @@ For more information try --help");
}

if connected == true && idle.as_minutes() < afk_after.try_into().expect("Couldn't convert afk_after to u64"){
let data = json!({
"cmd": "SET_ACTIVITY",
"args": {
"pid": std::process::id(),
"activity": None::<()>
},
"nonce": Uuid::new_v4().to_string()
});
client.send(data, 1).expect("Failed to clear activity");
client.clear_activity().expect("Failed to clear activity");
connected = false;
};
}
Expand Down

0 comments on commit 32dc5bc

Please sign in to comment.