Nostrum.Cache.GuildCache.get_by
You're seeing just the function
get_by
, go back to Nostrum.Cache.GuildCache module for more information.
Specs
get_by(clauses()) :: {:ok, Nostrum.Struct.Guild.t()} | {:error, reason()}
Retrives a single Nostrum.Struct.Guild
where it matches the clauses
.
Returns {:error, reason}
if no result was found.
iex> Nostrum.Cache.GuildCache.get_by(id: 0)
{:ok, %Nostrum.Struct.Guild{id: 0}}
iex> Nostrum.Cache.GuildCache.get_by(%{id: 0})
{:ok, %Nostrum.Struct.Guild{id: 0}}
iex> Nostrum.Cache.GuildCache.get_by(id: 10)
{:error, :id_not_found_on_guild_lookup}