#rich-presence #discord #discord-rich-presence #ipc

rpcdiscord

A simple, cross-platform crate for interfacing with Discord's IPC

2 releases

0.2.6 Jan 26, 2025
0.2.5 Jan 26, 2025

#9 in #discord-rich-presence

Download history 190/week @ 2025-01-24 42/week @ 2025-01-31 27/week @ 2025-02-07 26/week @ 2025-02-14 16/week @ 2025-02-21 10/week @ 2025-02-28 5/week @ 2025-03-07 32/week @ 2025-03-14 12/week @ 2025-03-21 15/week @ 2025-03-28 19/week @ 2025-04-04 32/week @ 2025-04-11

79 downloads per month
Used in tauri-plugin-drpc

MIT license

27KB
525 lines

Discord Rich Presence

crates.io

Fork of discord-rich-presence crate Changes:

  • Added support for Deserialize trait for structures

A simple, cross-platform crate to connect and send data to Discord's IPC. Special attention is given to sending rich presence data.

Example

use discord_rich_presence::{activity, DiscordIpc, DiscordIpcClient};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut client = DiscordIpcClient::new("<some application ID>")?;

    client.connect()?;
    client.set_activity(activity::Activity::new()
        .state("foo")
        .details("bar")
    )?;
    client.close()?;

    Ok(())
}

Running example on the CLI

The repository comes with an example you can run with cargo to set a dummy activity. Just provide a valid Client ID as the argument:

cargo run --example presence <CLIENT_ID>

Dependencies

~1–2MB
~41K SLoC