Skip to main content
A GuildMember is a user as a member of one server: the same person has one User, and one GuildMember per server they are in. You get one as the member of a command used in a server, with the events about members and messages, and from guild.members or guild.fetchMember().
How your functions receive a member is in Commands and Events. Which members the bot remembers is in Memory.

Properties

Snowflake
The id of the server.
User
The account of the member.
Snowflake
The id of the user.
Guild
The server the member is in.
string | null
The nickname of the member in this server, when they have one.
string
The name to show: nickname, or display name, or username.
readonly Snowflake[]
The ids of the roles of the member (@everyone is not listed).
Role[]
The roles of the member, @everyone included, highest first.
Role
The highest role of the member in the hierarchy; @everyone at least.
VoiceChannel | null
The voice channel the member is in; null when they are in none. The bot knows it when Discord sends it voice states: in a project with a file that joins a voice channel or listens to a voice event.
Date | null
When the member joined the server.
Date | null
Since when the member boosts the server.
boolean
Whether the member has not passed the membership screening yet.
Date | null
Until when the member is timed out; null when they are not.
boolean
Whether the member is timed out right now.
boolean
Whether the member owns the server.
Permissions
What the member can do in the server (channels may change it: see permissionsIn). See Permissions.

Helpers

These read what the bot remembers: they never send a request.

permissionsIn()

What the member can do in a channel of the server.

avatarURL()

The avatar of the member in this server, or else of their account. See ImageOptions.

isHigherThan()

Whether this member is above another one in the role hierarchy, which is what allows to kick, ban or rename them. Discord documentation

hasRole()

Whether the member has a role.

toString()

<@id>: mentions the member when put in a message.

toJSON()

The data of Discord as a plain object, with camelCase names.

Actions

edit()

Changes the member. See MemberEditOptions. Discord documentation

setNick()

Changes the nickname of the member; null removes it.

addRole()

Gives a role to the member. Discord documentation

removeRole()

Takes a role from the member. Discord documentation

timeout()

Prevents the member from writing, reacting and speaking for a while. duration is how long, in milliseconds (28 days at most).

removeTimeout()

Ends the timeout of the member.

kick()

Removes the member from the server; they can come back with an invite. Discord documentation

ban()

Bans the member from the server. See BanOptions. Discord documentation

send()

Sends a private message to the member. See MessageInput.

Types

BanOptions

What ban() takes, on a member or on a server. Every field can be left out.
string
Why, shown in the audit log of the server.
number
Also deletes the messages the user sent in the last seconds given: from 0 (the default, nothing) to 604800 (7 days).

MemberEditOptions

What edit() takes. Every field can be left out: only what you pass changes.
string | null
The nickname; null removes it.
(Snowflake | Role)[]
Replaces every role of the member.
boolean
Mutes the member in voice channels.
boolean
Deafens the member in voice channels.
Snowflake | { id: Snowflake } | null
Moves the member to another voice channel; null disconnects them.
Date | null
Until when the member is timed out; null ends the timeout.