Member

Member

Represents a guild member.

Constructor

new Member(client, data, options)

Description:
  • Creates the structure for a guild member.

Source:
See:
Parameters:
Name Type Description
client Client

The client instance.

data Object

The raw member data from Discord.

options Object

Additional options for the member.

Properties
Name Type Attributes Description
userId String

The id of the member.

guildId String

The id of the guild that the member belongs to.

user User <nullable>

A user object for this member.

nocache Boolean <nullable>

Whether this member should be cached.

Members

(readonly) avatarIsAnimated :Boolean

Description:
  • Whether the user has an animated avatar or not.

Source:

Whether the user has an animated avatar or not.

Type:
  • Boolean

(readonly) displayAvatarURL :String

Description:
  • The url of the member's avatar.

Source:

The url of the member's avatar.

Type:
  • String

(readonly) flags :Number

Description:
  • The flags for this user.

Source:

The flags for this user.

Type:
  • Number

(readonly, nullable) guild :Guild

Description:
  • The guild that this member belongs to.

Source:

The guild that this member belongs to.

Type:

(readonly) guildId :String

Description:
  • The id of the guild that this member belongs to.

Source:

The id of the guild that this member belongs to.

Type:
  • String

(readonly) hashName :String

Description:
  • The hash name for the member.

Source:

The hash name for the member.

Type:
  • String

(readonly) highestRolePosition :Number

Description:
  • The position of the member's highest role.

Source:

The position of the member's highest role.

Type:
  • Number

(readonly) id :String

Description:
  • The id of the member.

Source:

The id of the member.

Type:
  • String

(readonly, nullable) joinedAt :Number

Description:
  • The UNIX timestamp for when this member joined the guild.

Source:

The UNIX timestamp for when this member joined the guild.

Type:
  • Number

(readonly) mention :String

Description:
  • The mention string for the member.

Source:

The mention string for the member.

Type:
  • String

(readonly, nullable) nick :String

Description:
  • The nickname of the member.

Source:

The nickname of the member.

Type:
  • String

(readonly) pending :Boolean

Description:
  • Whether the user has not yet passed the guild's membership screening requirements.

Source:

Whether the user has not yet passed the guild's membership screening requirements.

Type:
  • Boolean

(readonly) permissions :BigInt

Description:
  • The overall calculated permissions for this member.

Source:

The overall calculated permissions for this member.

Type:
  • BigInt

(readonly) rejoined :Boolean

Description:
  • Whether the member has joined the guild before.

Source:

Whether the member has joined the guild before.

Type:
  • Boolean

(readonly) roles :Array.<Role>

Description:
  • The member's roles.

Source:

The member's roles.

Type:

(readonly, nullable) timeoutUntil :Number

Description:
  • The UNIX timestamp for when this member's timeout expires, if applicable.

Source:

The UNIX timestamp for when this member's timeout expires, if applicable.

Type:
  • Number

(readonly) user :User

Description:
  • The user object for this member.

Source:

The user object for this member.

Type:

Methods

(async, static) addRole(client, guildId, userId, roleId, options) → {Promise.<void>}

Description:
  • Adds a role to a member.

Source:
Parameters:
Name Type Description
client Client

The client instance.

guildId String

The guild id the member belongs to.

userId String

The id of the member who the action is occuring on.

roleId String

The id of the role to add.

options Object

The options for adding the role.

Properties
Name Type Description
reason String

The reason for adding the role.

Throws:
TypeError
Returns:
Type
Promise.<void>

(static) decrypt(client, data, guildId, userId) → {Member}

Description:
  • Decrypts a member.

Source:
Parameters:
Name Type Description
client Client

The client instance.

data String

The encrypted message data.

guildId String

The id of the guild that the message belongs to.

userId String

The id of the member.

Returns:
Type
Member

(static) getAvatarUrl(id, guild_id, hashnullable) → {String}

Description:
  • Returns the avatar url for the member.

Source:
Parameters:
Name Type Attributes Description
id String

The id of the user.

guild_id String

The id of the guild the user belongs to.

hash String <nullable>

The avatar hash of the user.

Returns:
Type
String

(static) getHashName(guildId, memberId) → {String}

Description:
  • Returns the hash name for the message.

Source:
Parameters:
Name Type Description
guildId String

The id of the guild that the message belongs to.

memberId String

The id of the member.

Returns:
Type
String

(static) getMention(userId) → {String}

Description:
  • Returns the mention string for the member.

Source:
Parameters:
Name Type Description
userId String

The id of the user to mention.

Returns:
Type
String

(async, static) removeRole(client, guildId, userId, roleId, options) → {Promise.<void>}

Description:
  • Removes a role from a member.

Source:
Parameters:
Name Type Description
client Client

The client instance.

guildId String

The guild id the member belongs to.

userId String

The id of the member who the action is occuring on.

roleId String

The id of the role to remove.

options Object

The options for removing the role.

Properties
Name Type Description
reason String

The reason for removing the role.

Throws:
TypeError
Returns:
Type
Promise.<void>

(static) shouldCache(gluonCacheOptions, guildCacheOptions) → {Boolean}

Description:
  • Determines whether the member should be cached.

Source:
Parameters:
Name Type Description
gluonCacheOptions GluonCacheOptions

The cache options for the client.

guildCacheOptions GuildCacheOptions

The cache options for the guild.

Returns:
Type
Boolean

(async) addRole(role_id, optionsnullable) → {Promise.<void>}

Description:
  • Adds a role to the member.

Source:
Parameters:
Name Type Attributes Description
role_id String

The id of the role to add to the member.

options Object <nullable>

The options for adding the role to the member.

Properties
Name Type Attributes Description
reason String <nullable>

The reason for adding the role to the member.

Throws:
TypeError | Error
Returns:
Type
Promise.<void>

encrypt() → {String}

Description:
  • Encrypts the member.

Source:
Returns:
Type
String

(async) massUpdateRoles(roles, optionsnullable) → {Promise.<void>}

Description:
  • Updates the member's roles.

Source:
Parameters:
Name Type Attributes Description
roles Array.<String>

An array of role ids for the roles the member should be updated with.

options Object <nullable>

The options for updating the member's roles.

Throws:
TypeError | Error
Returns:
Type
Promise.<void>

(async) removeRole(role_id, optionsnullable) → {Promise.<void>}

Description:
  • Removes a role from the member.

Source:
Parameters:
Name Type Attributes Description
role_id String

The id of the role to remove from the member.

options Object <nullable>

The options for removing the role from the member.

Properties
Name Type Attributes Description
reason String <nullable>

The reason for removing the role from the member.

Throws:
TypeError | Error
Returns:
Type
Promise.<void>

(async) timeoutAdd(timeout_until, optionsnullable) → {Promise.<void>}

Description:
  • Adds a timeout to the member.

Source:
Parameters:
Name Type Attributes Description
timeout_until Number

The UNIX timestamp for when the member's timeout should end.

options Object <nullable>

The options for timing out the member.

Properties
Name Type Attributes Description
reason String <nullable>

The reason for timing out the member.

Throws:
TypeError | Error
Returns:
Type
Promise.<void>

(async) timeoutRemove(optionsnullable) → {Promise.<void>}

Description:
  • Removes a timeout from the member.

Source:
Parameters:
Name Type Attributes Description
options Object <nullable>

The options for untiming out the member.

Properties
Name Type Attributes Description
reason String <nullable>

The reason for removing the time out from the member.

Throws:
TypeError | Error
Returns:
Type
Promise.<void>

toJSON(format) → {Object}

Description:
  • Returns the JSON representation of this structure.

Source:
Parameters:
Name Type Description
format Number

The format to return the data in.

Returns:
Type
Object

toString()

Source: