Nostrum.Cache.UserCache.get

You're seeing just the function get, go back to Nostrum.Cache.UserCache module for more information.

Specs

get(Nostrum.Struct.User.id()) ::
  {:error, atom()} | {:ok, Nostrum.Struct.User.t()}

Retrieves a user from the cache by id.

If successful, returns {:ok, user}. Otherwise, returns {:error, reason}.

Example

case Nostrum.Cache.UserCache.get(1111222233334444) do
  {:ok, user} ->
    "We found " <> user.username
  {:error, _reason} ->
    "No es bueno"
end