diff options
| author | Ken Swenson <[email protected]> | 2018-11-11 09:27:22 -0500 |
|---|---|---|
| committer | Ken Swenson <[email protected]> | 2018-11-11 09:27:22 -0500 |
| commit | d58221707ff5dce476b6c2a7caa5e586d2e4e710 (patch) | |
| tree | 574967fcd3b3e4f7384455619a14d2a3a9a703e1 | |
| parent | Revert "Remove Context::edit_profile" (diff) | |
| download | serenity-d58221707ff5dce476b6c2a7caa5e586d2e4e710.tar.xz serenity-d58221707ff5dce476b6c2a7caa5e586d2e4e710.zip | |
Update context and edit_profile doc test
| -rw-r--r-- | src/builder/edit_profile.rs | 2 | ||||
| -rw-r--r-- | src/client/context.rs | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/builder/edit_profile.rs b/src/builder/edit_profile.rs index 6084095..2efe77c 100644 --- a/src/builder/edit_profile.rs +++ b/src/builder/edit_profile.rs @@ -34,7 +34,7 @@ impl EditProfile { /// let base64 = utils::read_image("./my_image.jpg") /// .expect("Failed to read image"); /// - /// let _ = serenity::http::edit_profile(|mut profile| { + /// let _ = context.edit_profile(|mut profile| { /// profile.avatar(Some(&base64)); /// /// profile diff --git a/src/client/context.rs b/src/client/context.rs index 6574d53..9ca4f55 100644 --- a/src/client/context.rs +++ b/src/client/context.rs @@ -1,12 +1,19 @@ +use builder::EditProfile; +use CACHE; use client::bridge::gateway::ShardMessenger; +use error::Result; use gateway::InterMessage; +use http; use model::prelude::*; use parking_lot::Mutex; +use serde_json::Value; use std::sync::{ - mpsc::Sender, - Arc + Arc, + mpsc::Sender }; use typemap::ShareMap; +use utils::VecMap; +use utils::vecmap_to_json_map; /// The context is a general utility struct provided on event dispatches, which /// helps with dealing with the current "context" of the event dispatch. @@ -104,7 +111,7 @@ impl Context { } } - let edited = utils::vecmap_to_json_map(f(EditProfile(map)).0); + let edited = vecmap_to_json_map(f(EditProfile(map)).0); http::edit_profile(&edited) } |