Skip to content

Commit

Permalink
Add note about cache in UserId::get docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeyla Hellyer committed Jul 29, 2018
1 parent dd64787 commit e2873c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/model/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -738,9 +738,10 @@ impl UserId {
#[cfg(feature = "cache")]
pub fn find(&self) -> Option<Arc<RwLock<User>>> { CACHE.read().user(*self) }

/// Gets a user by its Id over the REST API.
/// Gets a user by its Id from either the cache or the REST API.
///
/// **Note**: The current user must be a bot user.
/// Searches the cache for the user first, if the cache is enabled. If the
/// user was not found, then the user is searched via the REST API.
#[inline]
pub fn get(&self) -> Result<User> {
#[cfg(feature = "cache")]
Expand Down

0 comments on commit e2873c8

Please sign in to comment.