Member - truemedian/Discordia GitHub Wiki
Inherits UserPresence
Represents a Discord guild member. Though one user may be a member in more than one guild, each presence is represented by a different member object associated with that guild.
getColor
hasPermission
getPermissions
addRole
removeRole
hasRole
setNickname
setVoiceChannel
mute
unmute
deafen
undeafen
kick
ban
unban
roles
name
nickname
joinedAt
voiceChannel
muted
deafened
guild
highestRoleInherited from Container
client
parentInherited from UserPresence
status
user
activity
Returns a color object that represents the member's color as determined by its highest colored role. If the member has no colored roles, then the default color with a value of 0 is returned.
Returns: Color
Checks whether the member has a specific permission. If
channel
is omitted, then only guild-level permissions are checked. This is a relatively expensive operation. If you need to check multiple permissions at once, use thegetPermissions
method and check the resulting object.
Name Type Optional channel GuildChannel x perm Permissions Resolvable Returns: boolean
Returns a permissions object that represents the member's total permissions for the guild, or for a specific channel if one is provided. If you just need to check one permission, use the
hasPermission
method.
Name Type Optional channel GuildChannel x Returns: Permissions
Adds a role to the member. If the member already has the role, then no action is taken. Note that the everyone role cannot be explicitly added.
Name Type id Role ID Resolvable Returns: boolean
Removes a role from the member. If the member does not have the role, then no action is taken. Note that the everyone role cannot be removed.
Name Type id Role ID Resolvable Returns: boolean
Checks whether the member has a specific role. This will return true for the guild's default role in addition to any explicitly assigned roles.
Name Type id Role ID Resolvable Returns: boolean
Sets the member's nickname. This must be between 1 and 32 characters in length. Pass
nil
to remove the nickname.
Name Type nick string Returns: boolean
Moves the member to a new voice channel, but only if the member has an active voice connection in the current guild. Due to complexities in voice state handling, the member's
voiceChannel
property will update asynchronously via WebSocket; not as a result of the HTTP request.
Name Type id Channel ID Resolvable Returns: boolean
Mutes the member in its guild.
Returns: boolean
Unmutes the member in its guild.
Returns: boolean
Deafens the member in its guild.
Returns: boolean
Undeafens the member in its guild.
Returns: boolean
Equivalent to
Member.guild:kickUser(Member.user, reason)
Name Type reason string Returns: boolean
Equivalent to
Member.guild:banUser(Member.user, reason, days)
Name Type reason string days number Returns: boolean
Equivalent to
Member.guild:unbanUser(Member.user, reason)
Name Type reason string Returns: boolean
An iterable array of guild roles that the member has. This does not explicitly include the default everyone role. Object order is not guaranteed.
Type: ArrayIterable
If the member has a nickname, then this will be equivalent to that nickname. Otherwise, this is equivalent to
Member.user.username
.Type: string
The member's nickname, if one is set.
Type: string|nil
The date and time at which the current member joined the guild, represented as an ISO 8601 string plus microseconds when available. Member objects generated via presence updates lack this property.
Type: string|nil
The voice channel to which this member is connected in the current guild.
Type: GuildVoiceChannel|nil
Whether the member is voice muted in its guild.
Type: boolean
Whether the member is voice deafened in its guild.
Type: boolean
The guild in which this member exists.
Type: Guild
The highest positioned role that the member has. If the member has no explicit roles, then this is equivalent to
Member.guild.defaultRole
.Type: Role
Inherited from Container
A shortcut to the client object to which this container is visible.
Type: Client
The parent object of to which this container is a child. For example, the parent of a role is the guild in which the role exists.
Type: Container|Client
Inherited from UserPresence
The user's online status (online, dnd, idle, offline).
Type: string
The user that this presence represents.
Type: User
The Activity that this presence represents.
Type: Activity