Crux vdev Crux.Structs.Role View Source

Represents a Discord Role Object.

Link to this section Summary

Functions

Creates a Crux.Structs.Role struct from raw data

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

Link to this section Types

Link to this type

t() View Source (since 0.1.0)
t() :: %Crux.Structs.Role{
  color: integer(),
  guild_id: Crux.Rest.snowflake(),
  hoist: boolean(),
  id: Crux.Rest.snowflake(),
  managed: boolean(),
  mentionable: boolean(),
  name: String.t(),
  permissions: integer(),
  position: integer()
}

Link to this section Functions

Link to this function

create(data) View Source (since 0.1.0)

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

Automatically invoked by Crux.Structs.create/2.

Link to this function

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

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

## Example

iex> %Crux.Structs.Role{id: 376146940762783746}
...> |> Crux.Structs.Role.to_mention()
"<@&376146940762783746>"