Bond-009 / discord-rich-presence

A cross-platform Discord Rich Presence library written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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_rich_presence::{activity, new_client, DiscordIpc};

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

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

    Ok(())
}

About

A cross-platform Discord Rich Presence library written in Rust

License:MIT License


Languages

Language:Rust 100.0%