Nostrum v0.4.0 Nostrum.Struct.Guild.Role View Source
Struct representing a Discord role.
Mentioning Roles in Messages
A Nostrum.Struct.Guild.Role
can be mentioned in message content using the String.Chars
protocol or mention/1
.
role = %Nostrum.Struct.Guild.Role{id: 431886897539973131}
Nostrum.Api.create_message!(184046599834435585, "#{role}")
%Nostrum.Struct.Message{}
role = %Nostrum.Struct.Guild.Role{id: 431884023535632398}
Nostrum.Api.create_message!(280085880452939778, "#{Nostrum.Struct.Guild.Role.mention(role)}")
%Nostrum.Struct.Message{}
Link to this section Summary
Types
The hexadecimal color code
Whether the role is pinned in the user listing
The id of the role
Whether the role is managed by an integration
Whether the role is mentionable
The name of the role
The permission bit set
The position of the role
Functions
Formats an Nostrum.Struct.Role
into a mention.
Link to this section Types
Link to this type
color()
View Source
color()
View Source
color() :: integer()
color() :: integer()
The hexadecimal color code
Link to this type
hoist()
View Source
hoist()
View Source
hoist() :: boolean()
hoist() :: boolean()
Whether the role is pinned in the user listing
Link to this type
id()
View Source
id()
View Source
id() :: Nostrum.Snowflake.t()
id() :: Nostrum.Snowflake.t()
The id of the role
Link to this type
managed()
View Source
managed()
View Source
managed() :: boolean()
managed() :: boolean()
Whether the role is managed by an integration
Link to this type
mentionable()
View Source
mentionable()
View Source
mentionable() :: boolean()
mentionable() :: boolean()
Whether the role is mentionable
Link to this type
name()
View Source
name()
View Source
name() :: String.t()
name() :: String.t()
The name of the role
Link to this type
permissions()
View Source
permissions()
View Source
permissions() :: integer()
permissions() :: integer()
The permission bit set
Link to this type
position()
View Source
position()
View Source
position() :: integer()
position() :: integer()
The position of the role
Link to this type
t()
View Source
t()
View Source
t() :: %Nostrum.Struct.Guild.Role{
color: color(),
hoist: hoist(),
id: id(),
managed: managed(),
mentionable: mentionable(),
name: name(),
permissions: permissions(),
position: position()
}
t() :: %Nostrum.Struct.Guild.Role{ color: color(), hoist: hoist(), id: id(), managed: managed(), mentionable: mentionable(), name: name(), permissions: permissions(), position: position() }
Link to this section Functions
Link to this function
mention(role) View Source
Formats an Nostrum.Struct.Role
into a mention.
Examples
iex> role = %Nostrum.Struct.Guild.Role{id: 431886639627763722}
...> Nostrum.Struct.Guild.Role.mention(role)
"<@&431886639627763722>"