Nostrum.Struct.Guild.Member (Nostrum v0.4.6) View Source
Struct representing a Discord guild member.
A Nostrum.Struct.Guild.Member
stores a Nostrum.Struct.User
's properties
pertaining to a specific Nostrum.Struct.Guild
.
Mentioning Members in Messages
A Nostrum.Struct.Guild.Member
can be mentioned in message content using the String.Chars
protocol or mention/1
.
member = %Nostrum.Struct.Guild.Member{user: Nostrum.Struct.User{id: 120571255635181568}}
Nostrum.Api.create_message!(184046599834435585, "#{member}")
%Nostrum.Struct.Message{content: "<@120571255635181568>"}
member = %Nostrum.Struct.Guild.Member{user: Nostrum.Struct.User{id: 89918932789497856}}
Nostrum.Api.create_message!(280085880452939778, "#{Nostrum.Struct.Guild.Member.mention(member)}")
%Nostrum.Struct.Message{content: "<@89918932789497856>"}
Link to this section Summary
Types
Whether the user is deafened.
If you dont request offline guild members this field will be nil
for any members that come online.
Date the user joined the guild.
If you dont request offline guild members this field will be nil
for any members that come online.
Whether the user is muted.
If you dont request offline guild members this field will be nil
for any members that come online.
The nickname of the user
A list of role ids
The user struct. This field can be nil
if the Member struct came as a partial Member object included
in a message received from a guild channel.
Functions
Returns a member's permissions in a guild channel, based on its Nostrum.Struct.Overwrite
s.
Returns a member's guild permissions.
Formats a Nostrum.Struct.Guild.Member
into a mention.
Link to this section Types
Specs
deaf() :: boolean() | nil
Whether the user is deafened.
If you dont request offline guild members this field will be nil
for any members that come online.
Specs
joined_at() :: String.t() | nil
Date the user joined the guild.
If you dont request offline guild members this field will be nil
for any members that come online.
Specs
mute() :: boolean() | nil
Whether the user is muted.
If you dont request offline guild members this field will be nil
for any members that come online.
Specs
nick() :: String.t() | nil
The nickname of the user
Specs
roles() :: [Nostrum.Struct.Guild.Role.id()]
A list of role ids
Specs
Specs
user() :: Nostrum.Struct.User.t() | nil
The user struct. This field can be nil
if the Member struct came as a partial Member object included
in a message received from a guild channel.
Link to this section Functions
Specs
guild_channel_permissions( t(), Nostrum.Struct.Guild.t(), Nostrum.Struct.Channel.id() ) :: [Nostrum.Permission.t()]
Returns a member's permissions in a guild channel, based on its Nostrum.Struct.Overwrite
s.
Examples
guild = Nostrum.Cache.GuildCache.get!(279093381723062272)
member = Map.get(guild.members, 177888205536886784)
channel_id = 381889573426429952
Nostrum.Struct.Guild.Member.guild_channel_permissions(member, guild, channel_id)
#=> [:manage_messages]
Specs
guild_permissions(t(), Nostrum.Struct.Guild.t()) :: [Nostrum.Permission.t()]
Returns a member's guild permissions.
Examples
guild = Nostrum.Cache.GuildCache.get!(279093381723062272)
member = Map.get(guild.members, 177888205536886784)
Nostrum.Struct.Guild.Member.guild_permissions(member, guild)
#=> [:administrator]
Specs
Formats a Nostrum.Struct.Guild.Member
into a mention.
Examples
iex> member = %Nostrum.Struct.Guild.Member{user: %Nostrum.Struct.User{id: 177888205536886784}}
...> Nostrum.Struct.Guild.Member.mention(member)
"<@177888205536886784>"