Skip to content

GuildMember

GuildMember ⇐ Base

Represents a member of a guild.

Kind: global class
Extends: Base

new GuildMember(data, guildId, client)

ParamTypeDescription
dataObjectThe data for the member.
guildIdstringThe ID of the guild the member belongs to.
clientClientThe client that instantiated this member.

guildMember.guild : Guild | null

The guild that the member belongs to.

Kind: instance property of GuildMember

guildMember.voice : VoiceState | null

Gets the voice state for the member.

Kind: instance property of GuildMember

guildMember.presence : Presence | null

Gets the presence for the member.

Kind: instance property of GuildMember

guildMember.permissions : Permissions

Gets the resolved permissions for the member.

Kind: instance property of GuildMember

guildMember.user : User | null

The user object for the member.

Kind: instance property of GuildMember

guildMember.isCommunicationDisabled() ⇒ boolean

Checks if the member’s communication is currently disabled.

Kind: instance method of GuildMember
Returns: boolean - - Whether communication is disabled.

guildMember.fetch(options) ⇒ Promise.<GuildMember>

Fetches this member from the API.

Kind: instance method of GuildMember
Returns: Promise.<GuildMember> - - The fetched member.

ParamTypeDescription
optionsObjectOptional options for the fetch.

guildMember.kick(reason) ⇒ Promise.<GuildMember>

Kicks this member from the guild.

Kind: instance method of GuildMember
Returns: Promise.<GuildMember> - - The kicked member.

ParamTypeDescription
reasonstringThe reason for the kick.

guildMember.send(options) ⇒ Promise.<Message>

Sends a DM to this member.

Kind: instance method of GuildMember
Returns: Promise.<Message> - - The sent message.

ParamTypeDescription
optionsObjectOptions for the DM.

guildMember.ban(options) ⇒ Promise.<GuildMember>

Bans this member from the guild.

Kind: instance method of GuildMember
Returns: Promise.<GuildMember> - - The banned member.

ParamTypeDescription
optionsObjectOptions for the ban.

guildMember.edit(options) ⇒ Promise.<GuildMember>

Edits this member.

Kind: instance method of GuildMember
Returns: Promise.<GuildMember> - - The edited member.

ParamTypeDescription
optionsObjectOptions for the edit.

guildMember.setNickname(nickname, reason) ⇒ Promise

Sets the member’s nickname.

Kind: instance method of GuildMember
Returns: Promise - A promise that resolves with the updated member object.

ParamTypeDescription
nicknamestringThe new nickname.
reasonstringThe reason for setting the nickname (optional).

guildMember.setMute(mute, reason) ⇒ Promise

Sets whether the member is muted.

Kind: instance method of GuildMember
Returns: Promise - A promise that resolves with the updated member object.

ParamTypeDescription
mutebooleanWhether to mute the member.
reasonstringThe reason for setting the mute (optional).

guildMember.setDeaf(deaf, reason) ⇒ Promise

Sets whether the member is deafened.

Kind: instance method of GuildMember
Returns: Promise - A promise that resolves with the updated member object.

ParamTypeDescription
deafbooleanWhether to deafen the member.
reasonstringThe reason for setting the deaf (optional).

guildMember.setChannel(channel, reason) ⇒ Promise

Moves the member to a different voice channel.

Kind: instance method of GuildMember
Returns: Promise - A promise that resolves with the updated member object.

ParamTypeDescription
channelChannelResolvableThe new voice channel.
reasonstringThe reason for moving the member (optional).

guildMember.setCommunicationDisabled(channel, reason) ⇒ Promise

Moves the member to a different voice channel.

Kind: instance method of GuildMember
Returns: Promise - A promise that resolves with the updated member object.

ParamTypeDescription
channelChannelResolvableThe new voice channel.
reasonstringThe reason for moving the member (optional).

guildMember.bannerURL(options) ⇒ string | null

The URL to the member’s guild banner image.

Kind: instance method of GuildMember
Returns: string | null - The URL to the banner image, or null if the member does not have a banner.

ParamTypeDescription
optionsObjectOptions for the banner URL (optional).
options.dynamicbooleanWhether to use the dynamic version of the banner (default: true).
options.sizenumberThe size of the banner (default: 2048).
options.formatstringThe format of the banner (default: “webp”).

guildMember.displayAvatarURL(options) ⇒ string

Returns the URL to the member’s display avatar.

Kind: instance method of GuildMember
Returns: string - The URL to the display avatar.

ParamTypeDescription
optionsObjectOptions for the avatar URL (optional).
options.dynamicbooleanWhether to use the dynamic version of the avatar (default: true).
options.sizenumberThe size of the avatar (default: 2048).
options.formatstringThe format of the avatar (default: “webp”).

guildMember.permissionsIn(channel) ⇒ PermissionOverwrites

Gets the permissions for the member in a given channel.

Kind: instance method of GuildMember
Returns: PermissionOverwrites - The resolved permissions for the member in the channel.
Throws:

  • RangeError Thrown if the channel is not cached.
ParamTypeDescription
channelChannelResolvableThe channel to get permissions for.

guildMember.permissionHas(perm) ⇒ boolean

Checks if the member has a given permission.

Kind: instance method of GuildMember
Returns: boolean - Whether the member has the permission.

ParamTypeDescription
permPermissionResolvableThe permission to check for.