discord-ipc-rp

Crates.iodiscord-ipc-rp
lib.rsdiscord-ipc-rp
version0.1.1
sourcesrc
created_at2023-12-29 00:36:23.399257
updated_at2023-12-29 00:54:53.85548
descriptionA simple, cross-platform crate for interfacing with Discord's IPC
homepage
repositoryhttps://github.com/Stefanuk12/discord-ipc
max_upload_size
id1082838
size52,529
Stefan (Stefanuk12)

documentation

README

Discord Rich Presence

crates.io Docs

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_ipc::{Result, activity, DiscordIpc, DiscordIpcClient};

fn main() -> Result<()> {
    let mut client = DiscordIpcClient::new("<some application ID>");

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

    std::thread::sleep(std::time::Duration::from_secs(5));

    client.close()?;

    Ok(())
}
Commit count: 71

cargo fmt