Appearance
GuildMember
Package: @erinjs/core
Represents a member of a guild.
Constructor
| Name | Type | Optional | Description |
|---|---|---|---|
client | Client | No | |
data | any | No | API guild member from GET /guilds/{id}/members or GET /guilds/{id}/members/ |
guild | Guild | No |
Properties
| Name | Type | Readonly | Optional | Description |
|---|---|---|---|---|
accentColor | number | null | Yes | No | |
avatar | string | null | Yes | No | |
banner | string | null | Yes | No | |
client | Client | Yes | No | |
communicationDisabledUntil | Date | null | No | No | |
deaf | boolean | Yes | No | |
displayName | string | Yes | No | Nickname, or global name, or username. |
guild | Guild | Yes | No | |
id | string | Yes | No | |
joinedAt | Date | Yes | No | |
mute | boolean | Yes | No | |
nick | string | null | No | No | |
permissions | any | Yes | No | Get the member's guild-level permissions (from roles only, no channel overwrites). |
| Use this for server-wide permission checks (e.g. ban, kick, manage roles). | ||||
profileFlags | number | null | Yes | No | |
roles | GuildMemberRoleManager | Yes | No | Role manager with add/remove/set and cache. Discord.js parity: member.roles.add(), member.roles.cache |
user | User | Yes | No |
Methods
addRole() async
Add a role to this member. Prefer member.roles.add(roleId) for Discord.js parity.
Returns: Promise<void>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
roleId | string | No | The role ID to add |
| Requires Manage Roles permission. |
avatarURL()
Get the guild-specific avatar URL for this member. Returns null if the member has no guild avatar (use displayAvatarURL for fallback).
Returns: string | null
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
options | { size?: number; extension?: string; } | Yes |
bannerURL()
Get the guild-specific banner URL for this member. Returns null if the member has no guild banner.
Returns: string | null
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
options | { size?: number; extension?: string; } | Yes |
displayAvatarURL()
Get the avatar URL to display for this member. Uses guild-specific avatar if set, otherwise falls back to the user's avatar.
Returns: string
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
options | { size?: number; extension?: string; } | Yes |
edit() async
Edit this guild member. PATCH /guilds/{id}/members/{userId} or /members/@me for the bot. For @me: nick, avatar, banner, bio, pronouns, accent_color, profile_flags, mute, deaf, communication_disabled_until, timeout_reason, channel_id, connection_id. For other members: same plus roles (array of role IDs).
Returns: Promise<this>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
options | { nick?: string | null; roles?: string[]; avatar?: string | null; banner?: string | null; bio?: string | null; pronouns?: string | null; accent_color?: number | null; profile_flags?: number | null; ... 5 more ...; connection_id?: string | null; } | No |
move() async
Move this member to a different voice channel or disconnect them from voice. Requires Move Members permission.
Returns: Promise<void>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
channelId | string | null | No | The voice channel ID to move the member to, or null to disconnect |
connectionId | string | null | Yes | Optional connection ID for the specific voice session (usually not needed) |
permissionsIn()
Compute the member's effective permissions in a guild channel. Applies role permissions and channel overwrites.
Returns: any
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
channel | GuildChannel | No | The guild channel to check permissions for |
removeRole() async
Remove a role from this member. Prefer member.roles.remove(roleId) for Discord.js parity.
Returns: Promise<void>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
roleId | string | No | The role ID to remove |
| Requires Manage Roles permission. |