Represents a Discord user.
Summary
Functions
Returns the CDN URL for the user's avatar, or nil if none set.
Returns true if the user is a bot. Accepts structs and raw maps.
Adds a change to an existing changeset for this entity.
Creates a changeset for batching mutations to this entity.
Creates a DM channel with a user. Returns a %EDA.Channel{} struct.
Returns the display name (global_name if set, otherwise username).
Fetches a user by ID. Checks cache first, falls back to REST.
Fetches a user by ID. Raises on error.
Returns a mention string like <@id>. Accepts structs and raw maps.
Types
@type t() :: %EDA.User{ accent_color: integer() | nil, avatar: String.t() | nil, banner: String.t() | nil, bot: boolean() | nil, discriminator: String.t() | nil, flags: integer() | nil, global_name: String.t() | nil, id: String.t() | nil, public_flags: integer() | nil, system: boolean() | nil, username: String.t() | nil }
Functions
Returns the CDN URL for the user's avatar, or nil if none set.
Accepts both %EDA.User{} structs and raw maps (from cache).
Returns true if the user is a bot. Accepts structs and raw maps.
@spec change(EDA.Entity.Changeset.t(), atom(), term()) :: EDA.Entity.Changeset.t()
Adds a change to an existing changeset for this entity.
@spec changeset(t()) :: EDA.Entity.Changeset.t()
Creates a changeset for batching mutations to this entity.
@spec create_dm(t() | String.t() | integer()) :: {:ok, EDA.Channel.t()} | {:error, term()}
Creates a DM channel with a user. Returns a %EDA.Channel{} struct.
Returns the display name (global_name if set, otherwise username).
Accepts both %EDA.User{} structs and raw maps (from cache).
Fetches a user by ID. Checks cache first, falls back to REST.
Fetches a user by ID. Raises on error.
Returns a mention string like <@id>. Accepts structs and raw maps.