Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

3
Cannot read properties of undefined (reading 'user')
Post Flair (click to view more posts with a particular flair)
Post Body

Hey, I am trying to make my code log the id of the mentioned user in the command. This is my code so far:

const mentionedMember = message.mentions.members.first()

console.log(mentionedMember.user.id)

It might be that "mentionedMember" is a mention. I am new to javascript so im not sure how i can fix this problem. Please let me know if you have an answer to this!

Thanks.

Comments
[not loaded or deleted]

Oh, I wasn't aware of that. Thanks for letting me know, might have to give it a try

[not loaded or deleted]

I was just agreeing with your move to a language with types

[not loaded or deleted]

JavaScript not having types is why I stopped using it and switched to Python so long ago for discord bots. Code is so much cleaner and errors are easier when you have types

Author
Account Strength
50%
Account Age
2 years
Verified Email
Yes
Verified Flair
No
Total Karma
31
Link Karma
26
Comment Karma
5
Profile updated: 21 hours ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago