#Cannot read properties of undefined (reading 'name')

1 messages · Page 1 of 1 (latest)

copper osprey
short sierra
#

Do you have a button file?

copper osprey
#

do you want my file structor?

short sierra
#

Sure

copper osprey
copper osprey
short sierra
#

Actually nvm

copper osprey
#

how is possibile?

short sierra
#

I read it wrong, where is the component handler in your file struct?

copper osprey
#

probably is an error in buttons file

short sierra
#

Can I see the code for your button?

#

You're probably exporting data wrong

copper osprey
#

which one?

short sierra
#

The first one

#

Not sure which button file is giving an error though, could be any other button file

copper osprey
#

i think that the wrong one is modifybutton

#

or the empty file

short sierra
#

Are you exporting your buttons like this?

module.exports = {
  data: {
    name: "name",
  },
short sierra
copper osprey
#

yes of course

short sierra
#

Well there's the issue

copper osprey
#

oh

#

let me try

short sierra
# copper osprey

Your handler is trying to receive name from this, but you never export it so it errors.

copper osprey
#

same error

#

i have just deleted it

#

oh no

short sierra
#

console.log(file) please

copper osprey
#

i have 1 empty file yet

#

wait

short sierra
#

Before you're setting the buttons

copper osprey
#

ok i think its working

short sierra
short sierra
copper osprey
short sierra
#

User does not have a roles property

#

use GuildMember

copper osprey
#

so interaction.GuildMember.role.cache....

short sierra
#

No

copper osprey
#

and what

short sierra
#

await guild.members.fetch(user.id);

#

You have to fetch the GuildMember

copper osprey
#

oh

#

i'm stupid

copper osprey
short sierra