From ccb154269d512e147457ebba70d56421841d6703 Mon Sep 17 00:00:00 2001 From: Mishio595 Date: Thu, 12 Jul 2018 11:41:41 -0600 Subject: revert some bad changes --- src/client/dispatch.rs | 9 +++++++++ src/utils/colour.rs | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/client/dispatch.rs b/src/client/dispatch.rs index 7bc9883..b661328 100644 --- a/src/client/dispatch.rs +++ b/src/client/dispatch.rs @@ -510,6 +510,15 @@ fn handle_event( }); }, DispatchEvent::Model(Event::MessageUpdate(mut event)) => { + let message = match CACHE.read().messages.get(&event.channel_id) { + Some(map) => { + match map.get(&event.id) { + Some(m) => Some(m.clone()), + None => None, + } + }, + None => None, + }; update!(event); let context = context(data, runner_tx, shard_id); diff --git a/src/utils/colour.rs b/src/utils/colour.rs index 3b31572..cac3d46 100644 --- a/src/utils/colour.rs +++ b/src/utils/colour.rs @@ -190,6 +190,20 @@ impl Colour { /// [`g`]: #method.g /// [`b`]: #method.b pub fn tuple(&self) -> (u8, u8, u8) { (self.r(), self.g(), self.b()) } + + /// Returns a hexadecimal string of this Colour. + /// + /// This is equivalent to passing the integer value through `std::fmt::UpperHex` with 0 padding + /// and 6 width + /// + /// # Examples + /// + /// ```rust + /// use serenity::utils::Colour; + /// + /// assert_eq!(Colour::new(6573123).hex(), String::from("644C43")); + /// ``` + pub fn hex(&self) -> String { format!("{:06X}", self.0) } } impl From for Colour { -- cgit v1.2.3