Crux vdev Crux.Structs.User View Source

Represents a Discord User Object

Link to this section Summary

Functions

Creates a Crux.Structs.User struct from raw data.

Converts a Crux.Structs.User into its discord mention format.

Link to this section Types

Link to this type

t() View Source (since 0.1.0)
t() :: %Crux.Structs.User{
  avatar: String.t() | nil,
  bot: boolean(),
  discriminator: String.t(),
  id: Crux.Rest.snowflake(),
  username: String.t()
}

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.User struct from raw data.

Automatically invoked by Crux.Structs.create/2.

Link to this function

to_mention(user) View Source (since 0.1.1)
to_mention(user :: Crux.Structs.User.t()) :: String.t()

Converts a Crux.Structs.User into its discord mention format.

iex> %Crux.Structs.User{id: 218348062828003328}
...> |> Crux.Structs.User.to_mention()
"<@218348062828003328>"