简体   繁体   中英

message.mentions.users.first() not defined - discord.js

const user = message.mentions.users.first();
console.log(user)

This is just a snippet of code, but the console outputs undefined. Above this is boilerplate command handler stuff. Other things work fine, but the message.mentions.users.first is the problem. I've tried almost everything from other questions like this. Any ideas?

Reginald is the role not a user that's why message.mentions gives you 'mentionable:false' check if there is role same name as 'Reginald'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM