Crates.io | discord-ipc-rp |
lib.rs | discord-ipc-rp |
version | 0.1.1 |
source | src |
created_at | 2023-12-29 00:36:23.399257 |
updated_at | 2023-12-29 00:54:53.85548 |
description | A simple, cross-platform crate for interfacing with Discord's IPC |
homepage | |
repository | https://github.com/Stefanuk12/discord-ipc |
max_upload_size | |
id | 1082838 |
size | 52,529 |
A simple, cross-platform crate to connect and send data to Discord's IPC. Special attention is given to sending rich presence data.
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(())
}