GuildMember
GuildMember ⇐ Base
Section titled “GuildMember ⇐ Base”Represents a member of a guild.
Kind: global class
Extends: Base
- GuildMember ⇐
Base- new GuildMember(data, guildId, client)
- .guild :
Guild|null - .voice :
VoiceState|null - .presence :
Presence|null - .permissions :
Permissions - .user :
User|null - .isCommunicationDisabled() ⇒
boolean - .fetch(options) ⇒
Promise.<GuildMember> - .kick(reason) ⇒
Promise.<GuildMember> - .send(options) ⇒
Promise.<Message> - .ban(options) ⇒
Promise.<GuildMember> - .edit(options) ⇒
Promise.<GuildMember> - .setNickname(nickname, reason) ⇒
Promise - .setMute(mute, reason) ⇒
Promise - .setDeaf(deaf, reason) ⇒
Promise - .setChannel(channel, reason) ⇒
Promise - .setCommunicationDisabled(channel, reason) ⇒
Promise - .bannerURL(options) ⇒
string|null - .displayAvatarURL(options) ⇒
string - .permissionsIn(channel) ⇒
PermissionOverwrites - .permissionHas(perm) ⇒
boolean
new GuildMember(data, guildId, client)
Section titled “new GuildMember(data, guildId, client)”| Param | Type | Description |
|---|---|---|
| data | Object | The data for the member. |
| guildId | string | The ID of the guild the member belongs to. |
| client | Client | The client that instantiated this member. |
guildMember.guild : Guild | null
Section titled “guildMember.guild : Guild | null”The guild that the member belongs to.
Kind: instance property of GuildMember
guildMember.voice : VoiceState | null
Section titled “guildMember.voice : VoiceState | null”Gets the voice state for the member.
Kind: instance property of GuildMember
guildMember.presence : Presence | null
Section titled “guildMember.presence : Presence | null”Gets the presence for the member.
Kind: instance property of GuildMember
guildMember.permissions : Permissions
Section titled “guildMember.permissions : Permissions”Gets the resolved permissions for the member.
Kind: instance property of GuildMember
guildMember.user : User | null
Section titled “guildMember.user : User | null”The user object for the member.
Kind: instance property of GuildMember
guildMember.isCommunicationDisabled() ⇒ boolean
Section titled “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>
Section titled “guildMember.fetch(options) ⇒ Promise.<GuildMember>”Fetches this member from the API.
Kind: instance method of GuildMember
Returns: Promise.<GuildMember> - - The fetched member.
| Param | Type | Description |
|---|---|---|
| options | Object | Optional options for the fetch. |
guildMember.kick(reason) ⇒ Promise.<GuildMember>
Section titled “guildMember.kick(reason) ⇒ Promise.<GuildMember>”Kicks this member from the guild.
Kind: instance method of GuildMember
Returns: Promise.<GuildMember> - - The kicked member.
| Param | Type | Description |
|---|---|---|
| reason | string | The reason for the kick. |
guildMember.send(options) ⇒ Promise.<Message>
Section titled “guildMember.send(options) ⇒ Promise.<Message>”Sends a DM to this member.
Kind: instance method of GuildMember
Returns: Promise.<Message> - - The sent message.
| Param | Type | Description |
|---|---|---|
| options | Object | Options for the DM. |
guildMember.ban(options) ⇒ Promise.<GuildMember>
Section titled “guildMember.ban(options) ⇒ Promise.<GuildMember>”Bans this member from the guild.
Kind: instance method of GuildMember
Returns: Promise.<GuildMember> - - The banned member.
| Param | Type | Description |
|---|---|---|
| options | Object | Options for the ban. |
guildMember.edit(options) ⇒ Promise.<GuildMember>
Section titled “guildMember.edit(options) ⇒ Promise.<GuildMember>”Edits this member.
Kind: instance method of GuildMember
Returns: Promise.<GuildMember> - - The edited member.
| Param | Type | Description |
|---|---|---|
| options | Object | Options for the edit. |
guildMember.setNickname(nickname, reason) ⇒ Promise
Section titled “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.
| Param | Type | Description |
|---|---|---|
| nickname | string | The new nickname. |
| reason | string | The reason for setting the nickname (optional). |
guildMember.setMute(mute, reason) ⇒ Promise
Section titled “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.
| Param | Type | Description |
|---|---|---|
| mute | boolean | Whether to mute the member. |
| reason | string | The reason for setting the mute (optional). |
guildMember.setDeaf(deaf, reason) ⇒ Promise
Section titled “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.
| Param | Type | Description |
|---|---|---|
| deaf | boolean | Whether to deafen the member. |
| reason | string | The reason for setting the deaf (optional). |
guildMember.setChannel(channel, reason) ⇒ Promise
Section titled “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.
| Param | Type | Description |
|---|---|---|
| channel | ChannelResolvable | The new voice channel. |
| reason | string | The reason for moving the member (optional). |
guildMember.setCommunicationDisabled(channel, reason) ⇒ Promise
Section titled “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.
| Param | Type | Description |
|---|---|---|
| channel | ChannelResolvable | The new voice channel. |
| reason | string | The reason for moving the member (optional). |
guildMember.bannerURL(options) ⇒ string | null
Section titled “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.
| Param | Type | Description |
|---|---|---|
| options | Object | Options for the banner URL (optional). |
| options.dynamic | boolean | Whether to use the dynamic version of the banner (default: true). |
| options.size | number | The size of the banner (default: 2048). |
| options.format | string | The format of the banner (default: “webp”). |
guildMember.displayAvatarURL(options) ⇒ string
Section titled “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.
| Param | Type | Description |
|---|---|---|
| options | Object | Options for the avatar URL (optional). |
| options.dynamic | boolean | Whether to use the dynamic version of the avatar (default: true). |
| options.size | number | The size of the avatar (default: 2048). |
| options.format | string | The format of the avatar (default: “webp”). |
guildMember.permissionsIn(channel) ⇒ PermissionOverwrites
Section titled “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:
RangeErrorThrown if the channel is not cached.
| Param | Type | Description |
|---|---|---|
| channel | ChannelResolvable | The channel to get permissions for. |
guildMember.permissionHas(perm) ⇒ boolean
Section titled “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.
| Param | Type | Description |
|---|---|---|
| perm | PermissionResolvable | The permission to check for. |