'How do I get the creation date of a mentioned player [DISCORD.JS V13]
Note: I'm using v13 of "discord.js".
This is the command that I currently have:
if (command === 'check') {
if (message.member.permissions.has(['KICK_MEMBERS'])) {
let mentioned = message.mentions.users.first();
let name = mentioned.username
message.channel.send(`Account name: ${name}.`)
message.channel.send(`Account ID: ${mentioned.user.}`)
} else if (!message.member.permissions.has(
['KICK_MEMBERS'])) {
message.channel.send('You do not have permissions to do this command!')
} else {
message.channel.send('An error has occured while attempting to run the command.')
} }
The let mentioned = message.mentions.users.first(); gets the mentioned user
This is how you say the command:
!check @Downrest
Okay, so here's my question.
How do I get the creation date of mentioned?
Solution 1:[1]
According to the docs, you can see in the User class that you have a property called createdAt that returns a Date, so mentioned.createdAt should return the creation date of the user.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Iliannnn |
