TypeError: Cannot read properties of undefined (reading 'user')

Hi. Can someone tell me what's the problem here? :D
14 Replies
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
not Kuma.
not Kuma.•2y ago
dc.js 14.7.1 node 16.18.0
dzlandis
dzlandis•2y ago
I'm not sure what interaction.target.username is But I think that error is telling you that target doesn't exist, which it doesn't tmk
not Kuma.
not Kuma.•2y ago
dzlandis
dzlandis•2y ago
I think you are looking for interaction.user.username
not Kuma.
not Kuma.•2y ago
not Kuma.
not Kuma.•2y ago
im trying to bring into title username of user that i've mentioned in .addUserOption
dzlandis
dzlandis•2y ago
I think you should be using just target.username then As you are defining the interaction user target as target
not Kuma.
not Kuma.•2y ago
doesnt work too. Tried to do it with discordjs.guide and everytime same error with that Username tried interaction.target.username target.username target.user.username and some others nothing works :/
dzlandis
dzlandis•2y ago
You have no target option in your command it seems 🤔 The option appears to be some name in a different language You'll want to specify that name for the option instead of .getUser('target')
not Kuma.
not Kuma.•2y ago
so i need to change that "Użytkownik" into target?
dzlandis
dzlandis•2y ago
Yeah or the other way around, depending on what you want the option to be called
not Kuma.
not Kuma.•2y ago
Worked. Thanks a lot <3 You're the best :D
dzlandis
dzlandis•2y ago
Awesome, happy to help :)