Skip to content

$oldMember

$oldMember holds data for the member before it was updated, this is from discord cache and might be empty depending on whether it’s cached, so use partial option before attempting to access any property. (memberUpdate event)

Usage

$oldMember[option]

Parameters

FieldTypeDescriptionRequired
optionstringOption to retrieve.true

Options

FieldTypeDescription
idnumberReturns User ID.
namestringReturns Name of user.
rolesstringReturns User roles.
permissionsstringReturns User permissions.
nickstringReturns User nickname.
highestRoleIDnumberReturns Higher role ID user has.
joinedStampnumberReturns user joined timestamp.
removedPermissionsstringReturns permissions removed from the user.
removedRolesstringReturns roles removed from the user.
bannablebooleanReturns if user is bannable.
kickablebooleanReturns if user is kickable.
manageablebooleanReturns if user is manageable.

Example(s)

  • Note: You need GuildMembers intent
1
client.memberUpdateCommand({
2
channel: "channelid",
3
code: `
4
$username[$newMember[id]] has updated their nickname!
5
- New Nickname: $newMember[nick]
6
- Old Nickname: $oldMember[nick]
7
8
$username[$newMember[id]] has updated their name!
9
- New Name: $newMember[name]
10
- Old Name: $oldMember[name]`
11
});
  • This code will execute when member updates their guild nickname or discord username