You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Michael Pfaff 2b2b47454c
Remove build.sbt
9 months ago
.vscode Add disconnect and clearActivity 1 year ago
examples Suppress std::io::NotFound errors 10 months ago
java Remove build.sbt 9 months ago
src See message 1 year ago
.editorconfig Add Discord rich presence support 5 years ago
.gitignore Add partial Java bindings 1 year ago Update 1 year ago Cleanup some stuff 1 year ago
Cargo.toml See message 1 year ago
LICENSE Add LICENSE 5 years ago Remove badges and add link to original repo 1 year ago

Discord RPC Client

This is a fork of

Discord RPC client for Rust


Add this to your Cargo.toml:

discord-rpc-client = "^0.2"


extern crate discord_rpc_client;

use std::{env, thread, time};
use discord_rpc_client::Client;

fn main() {
    // Get our main status message
    let state_message = env::args().nth(1).expect("Requires at least one argument");

    // Create the client
    let mut drpc = Client::new(425407036495495169);

    // Start up the client connection, so that we can actually send and receive stuff

    // Set the activity
    drpc.set_activity(|act| act.state(state_message))
        .expect("Failed to set activity");

    // Wait 10 seconds before exiting

More examples can be found in the examples directory.