From de4949009ac3f144f3f0177892e7d376847e45a1 Mon Sep 17 00:00:00 2001 From: DylanCa Date: Sat, 13 Jan 2024 12:35:25 +0100 Subject: [PATCH] Updated README instructions --- README.md | 16 ++++++++++------ src/models/error.rs | 0 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 src/models/error.rs diff --git a/README.md b/README.md index 1556eab..7cd32d0 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,19 @@ Rust Discord Activity is available directly on [crates.io](https://crates.io/cra `cargo add rust-discord-activity` ## How to use -Three steps: -1. Create your Activity and set desired data using provided structs -2. Create a new Payload with your Activity -3. Instantiate a new DiscordClient and send your Payload through it +1. Instantiate a new DiscordClient +2. Create your Activity and set desired data using provided structs +3. Create a new Payload with your Activity +4. Send your Payload through the DiscordClient Et voilĂ  ! ## Example ```rust +let mut client = DiscordClient::new(""); + let limg = Some(String::from("https://placehold.co/600x400/png")); -let simg = Some(String::from("https://placehold.co/600x400/png")); +let simg = Some(String::from("https://placehold.co/200x100/png")); let asset = Asset::new(limg, None, simg, None); let now_in_millis = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis(); let timestamp = Timestamp::new(Some(now_in_millis - 10000), None); @@ -40,7 +42,6 @@ activity let payload = Payload::new(EventName::Activity, EventData::Activity(activity)); -let mut client = DiscordClient::new(""); let _ = client.send_payload(payload); ``` @@ -49,6 +50,9 @@ And voilĂ ! This sets-up a new Activity for the current Discord user: Discord Rich Presence +## Limitations +For the moment, the library only works with MacOS and local Discord application. + ## Next Steps - Write proper documentation for this library - Write unit tests diff --git a/src/models/error.rs b/src/models/error.rs new file mode 100644 index 0000000..e69de29