Skip to main content

timed_sync/
timed-sync.rs

1use std::{thread::sleep, time::Duration};
2
3use filthy_rich::DiscordIPCSync;
4
5fn main() {
6    let mut client = DiscordIPCSync::new("1463450870480900160")
7        .unwrap()
8        .on_ready(|| println!("filthy-rich is READY to set activity updates."));
9
10    // first run
11    client.run(true).unwrap();
12
13    client
14        .set_activity("this runs".to_string(), Some("for ten seconds".to_string()))
15        .unwrap();
16    sleep(Duration::from_secs(5));
17    client
18        .set_activity("believe it".to_string(), Some("or not!".to_string()))
19        .unwrap();
20    sleep(Duration::from_secs(5));
21}