diff options
| author | Zeyla Hellyer <[email protected]> | 2018-07-29 14:09:27 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2018-07-29 14:09:27 -0700 |
| commit | e2873c820c1134ea7cc4cfbe99467aac350fa892 (patch) | |
| tree | 4d6133785836b508a9c301b7aa16a112afa15192 /src | |
| parent | Update license/Cargo email (diff) | |
| download | serenity-e2873c820c1134ea7cc4cfbe99467aac350fa892.tar.xz serenity-e2873c820c1134ea7cc4cfbe99467aac350fa892.zip | |
Add note about cache in UserId::get docs
Diffstat (limited to 'src')
| -rw-r--r-- | src/model/user.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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<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")] |