From e2873c820c1134ea7cc4cfbe99467aac350fa892 Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Sun, 29 Jul 2018 14:09:27 -0700 Subject: Add note about cache in UserId::get docs --- src/model/user.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/model/user.rs b/src/model/user.rs index a378be5..859f168 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -738,9 +738,10 @@ impl UserId { #[cfg(feature = "cache")] pub fn find(&self) -> Option>> { 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 { #[cfg(feature = "cache")] -- cgit v1.2.3