timed/
timed.rs

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