Skip to content

vionya/discord-rich-presence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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, 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>

About

A cross-platform Discord Rich Presence library written in Rust

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages