Expand description
This library provides easy access to the Discord IPC.
It provides implementations for both Unix and Windows operating systems, with both implementations using the same API. Thus, this crate can be used in a platform-agnostic manner.
§Hello world
use discord_rich_presence::{activity, DiscordIpc, DiscordIpcClient};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut client = DiscordIpcClient::new("<some client id>")?;
client.connect()?;
let payload = activity::Activity::new().state("Hello world!");
client.set_activity(payload)?;
}Modules§
- activity
- Provides an interface for building activities to send
to Discord via
DiscordIpc::set_activity. - error
- Error types for this crate.
Structs§
- Discord
IpcClient - A wrapper struct for the functionality contained in the
underlying
DiscordIpctrait.
Traits§
- Discord
Ipc - A client that connects to and communicates with the Discord IPC.