Represents a Discord guild role.
Summary
Functions
Applies a changeset to a role. No-op if the changeset has no changes.
Adds a change to an existing changeset for this entity.
Creates a changeset for batching mutations to this entity.
Creates a role in a guild.
Deletes a guild role.
Fetches a role by guild ID and role ID. Checks cache first, falls back to REST.
Returns a mention string like <@&id>.
Modifies a guild role.
Types
@type t() :: %EDA.Role{ color: integer() | nil, hoist: boolean() | nil, icon: String.t() | nil, id: String.t() | nil, managed: boolean() | nil, mentionable: boolean() | nil, name: String.t() | nil, permissions: String.t() | nil, position: integer() | nil, tags: map() | nil, unicode_emoji: String.t() | nil }
Functions
@spec apply_changeset(String.t() | integer(), EDA.Entity.Changeset.t(), keyword()) :: {:ok, t()} | {:error, term()}
Applies a changeset to a role. No-op if the changeset has no changes.
Requires guild_id since roles are guild-scoped.
Options
:reason- Audit log reason
@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.
Creates a role in a guild.
Options
:reason- Audit log reason
@spec delete(String.t() | integer(), t() | String.t() | integer(), keyword()) :: :ok | {:error, term()}
Deletes a guild role.
Options
:reason- Audit log reason
Fetches a role by guild ID and role ID. Checks cache first, falls back to REST.
Returns a mention string like <@&id>.
@spec modify(String.t() | integer(), t() | String.t() | integer(), map(), keyword()) :: {:ok, t()} | {:error, term()}
Modifies a guild role.
Options
:reason- Audit log reason