Skip to content

Commit

Permalink
Fix is_own code
Browse files Browse the repository at this point in the history
The current user ID is located on the `user` structfield in the cache,
and is not directly on the cache.
  • Loading branch information
Zeyla Hellyer committed Jul 26, 2017
1 parent fdbfbe0 commit 6572580
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/model/channel/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl Message {
/// A util function for determining whether this message was sent by someone else, or the bot.
#[cfg(all(feature="cache", feature="utils"))]
pub fn is_own(&self) -> bool {
self.author.id == CACHE.read().unwrap().id
self.author.id == CACHE.read().unwrap().user.id
}

/// Deletes the message.
Expand Down

0 comments on commit 6572580

Please sign in to comment.