Crux v2020-03-17 17:55:51Z Crux.Structs.Reaction View Source

Represents a Discord Reaction Object.

Link to this section Summary

Types

All available types that can be resolved into a reaction / emoji id.

t()

Link to this section Types

All available types that can be resolved into a reaction / emoji id.

Link to this type

t() View Source (since 0.1.0)
t() :: %Crux.Structs.Reaction{
  count: integer(),
  emoji: Crux.Structs.Emoji.t(),
  me: boolean()
}

Link to this section Functions

Link to this function

create(data) View Source (since 0.1.0)
create(data :: map()) :: t()

Creates a Crux.Structs.Presence.t/0 struct from raw data.

Automatically invoked by Crux.Structs.create/2.

Link to this function

resolve_id(resolvable) View Source (since 0.2.1)
resolve_id(id_resolvable()) :: Crux.Structs.Snowflake.t() | nil

Resolves the id of a Crux.Structs.Reaction.t/0.

Automatically invoked by Crux.Structs.resolve_id/2.

  iex> %Crux.Structs.Reaction{emoji: %Crux.Structs.Emoji{id: 618731477143912448}}
  ...> |> Crux.Structs.Reaction.resolve_id()
  618731477143912448

  iex> %Crux.Structs.Emoji{id: 618731477143912448}
  ...> |> Crux.Structs.Reaction.resolve_id()
  618731477143912448

  iex> 618731477143912448
  ...> |> Crux.Structs.Reaction.resolve_id()
  618731477143912448

  iex> "618731477143912448"
  ...> |> Crux.Structs.Reaction.resolve_id()
  618731477143912448