timed/timed.rs
1use anyhow::Result;
2use std::time::Duration;
3
4use filthy_rich::DiscordIPC;
5use tokio::time::sleep;
6
7#[tokio::main]
8async fn main() -> Result<()> {
9 let mut client = DiscordIPC::new("1463450870480900160");
10
11 // first run
12 client.run().await.unwrap();
13
14 client.set_activity("this runs", "for ten seconds").await?;
15 sleep(Duration::from_secs(5)).await;
16 client.set_activity("believe it", "or not").await?;
17 sleep(Duration::from_secs(5)).await;
18
19 Ok(())
20}