Update example
This commit is contained in:
parent
95d748f211
commit
20044cbea4
|
@ -3,7 +3,10 @@ extern crate discord_rpc_client;
|
||||||
|
|
||||||
use simplelog::*;
|
use simplelog::*;
|
||||||
use std::{thread, time};
|
use std::{thread, time};
|
||||||
use discord_rpc_client::Client as DiscordRPC;
|
use discord_rpc_client::{
|
||||||
|
Client as DiscordRPC,
|
||||||
|
models::Event,
|
||||||
|
};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
TermLogger::init(LevelFilter::Debug, Config::default()).unwrap();
|
TermLogger::init(LevelFilter::Debug, Config::default()).unwrap();
|
||||||
|
@ -22,5 +25,16 @@ fn main() {
|
||||||
.small_text("rusting...")))
|
.small_text("rusting...")))
|
||||||
.expect("Failed to set presence");
|
.expect("Failed to set presence");
|
||||||
|
|
||||||
|
drpc.subscribe(Event::ActivityJoin, |j| j
|
||||||
|
.secret("123456"))
|
||||||
|
.expect("Failed to subscribe to event");
|
||||||
|
|
||||||
|
drpc.subscribe(Event::ActivitySpectate, |s| s
|
||||||
|
.secret("123456"))
|
||||||
|
.expect("Failed to subscribe to event");
|
||||||
|
|
||||||
|
drpc.subscribe(Event::ActivityJoinRequest, |s| s)
|
||||||
|
.expect("Failed to subscribe to event");
|
||||||
|
|
||||||
loop { thread::sleep(time::Duration::from_secs(10)) };
|
loop { thread::sleep(time::Duration::from_secs(10)) };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue