Go to file
Michael Pfaff 2b2b47454c
Remove build.sbt
2022-09-09 07:29:10 -04:00
.vscode Add disconnect and clearActivity 2022-03-21 13:19:12 -04:00
examples Suppress std::io::NotFound errors 2022-08-16 14:31:44 -04:00
java Remove build.sbt 2022-09-09 07:29:10 -04:00
src See message 2022-03-26 23:06:08 -04:00
.editorconfig Add Discord rich presence support 2018-03-22 15:35:48 +01:00
.gitignore Add partial Java bindings 2022-02-03 16:56:26 -05:00
CHANGELOG.md Update CHANGELOG.md 2022-02-03 17:01:02 -05:00
CONTRIBUTING.md Cleanup some stuff 2022-02-03 16:57:40 -05:00
Cargo.toml See message 2022-03-26 23:06:08 -04:00
LICENSE Add LICENSE 2018-03-22 17:43:30 +00:00
README.md Remove badges and add link to original repo 2022-02-03 18:40:32 -05:00

README.md

Discord RPC Client

This is a fork of https://gitlab.com/valeth/discord-rpc-client.rs

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