crux_structs v0.2.3 Crux.Structs.Presence View Source
Represents a Discord Presence Object.
Differences opposed to the Discord API Object:
:user
is just the user id
Link to this section Summary
Functions
Creates a t:Crux.Structs.Presence.t/0
struct from raw data.
Resolves the id of a t:Crux.Structs.Presence.t/0
Link to this section Types
Specs
activity() :: %{ :name => String.t(), :type => integer(), optional(:url) => nil | String.t(), :created_at => integer(), optional(:timestamps) => map(), optional(:application_id) => Crux.Structs.Snowflake.t(), optional(:details) => String.t() | nil, optional(:state) => String.t() | nil, optional(:emoji) => Crux.Structs.Emoji.t() | nil, optional(:party) => map(), optional(:assets) => map(), optional(:secrets) => map(), optional(:instance) => boolean(), optional(:flags) => Crux.Structs.Presence.ActivityFlags.raw() }
Represents an Activity Structure.
Specs
id_resolvable() :: Crux.Structs.User.id_resolvable()
All available types that can be resolved into a user id.
Specs
Link to this section Functions
Specs
Creates a t:Crux.Structs.Presence.t/0
struct from raw data.
Automatically invoked by
Crux.Structs.create/2
.
Specs
resolve_id(id_resolvable()) :: Crux.Structs.Snowflake.t() | nil
Resolves the id of a t:Crux.Structs.Presence.t/0
Automatically invoked by
Crux.Structs.resolve_id/2
iex> %Crux.Structs.Presence{user: 218348062828003328}
...> |> Crux.Structs.Presence.resolve_id()
218348062828003328
For more examples see Crux.Structs.User.resolve_id/1