Go to file
Patrick Auernig 7c10e1dbc5 Update Cargo.toml
Update version to 0.3.0
2018-12-06 02:09:37 +01:00
.git-hooks/pre_push Add Discord rich presence support 2018-03-22 15:35:48 +01:00
examples Rewrite connection manager 2018-12-06 01:05:06 +01:00
src Allow cloning of Client instances 2018-12-06 02:08:26 +01:00
.editorconfig Add Discord rich presence support 2018-03-22 15:35:48 +01:00
.gitignore Update gitignore 2018-12-04 22:28:53 +01:00
.gitlab-ci.yml Update GitLab CI configuration 2018-12-04 22:16:47 +01:00
.overcommit.yml Add Discord rich presence support 2018-03-22 15:35:48 +01:00
CHANGELOG.md Update changelog 2018-12-06 01:05:06 +01:00
CONTRIBUTING.md Fix typo in CONTRIBUTING.md 2018-04-09 16:51:08 +02:00
Cargo.toml Update Cargo.toml 2018-12-06 02:09:37 +01:00
LICENSE Add LICENSE 2018-03-22 17:43:30 +00:00
README.md Update readme 2018-12-06 01:27:39 +01:00
appveyor.yml Build examples in CI 2018-04-09 19:34:31 +02:00

README.md

Build Status Build status crates.io crates.io Discord

Discord RPC Client

Discord RPC client for Rust

Installation

Add this to your Cargo.toml:

[dependencies]
discord-rpc-client = "^0.2"

Example

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
    drpc.start();

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

    // Wait 10 seconds before exiting
    thread::sleep(time::Duration::from_secs(10));
}

More examples can be found in the examples directory.

Contributions

See CONTRIBUTING.md