crux_structs v0.1.3 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
t() :: %Crux.Structs.Role{
  color: integer(),
  guild_id: integer(),
  hoist: boolean(),
  id: integer(),
  managed: boolean(),
  mentionable: boolean(),
  name: String.t(),
  permissions: integer(),
  position: integer()
}

Link to this section Functions

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
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>"