#Problem with self roles with bottons

1 messages · Page 1 of 1 (latest)

proud geode
#

Hi! I have a problem with the roles with buttons on a bot on discord.js. This is the error in the string: const hasRole = interaction.member.roles.cache.has(role.id); throw er; // Unhandled 'error' event
^

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

#

How to resolve?

muted pecan
#

what is role defined as?

proud geode
dawn cape
#

do throw err

#

With 2 r

proud geode
dawn cape
#

Oh thats not your real problem

#

But send your code

muted pecan
proud geode
dawn cape
#

Oh bedankt

muted pecan
proud geode
#

and is correct

#

How can I resolve?

muted pecan
#

const role = interaction.guild.roles.cache.get(ROLES[interaction.customId.toUpperCase()])

dawn cape
#

Why tf do you have 2 interactionCreate events????

muted pecan
proud geode
muted pecan
#

by make it return a correct role id

proud geode
muted pecan
proud geode
#

that you write up

muted pecan
#

I didn’t?
I just told you the issue in YOUR code

proud geode
muted pecan
#

well, how am I supposed to know?

#

it’s not my code

#

you wrote it

#

I didn’t

proud geode
#

By tutorials

#

And I don't say to resolve the problem

dawn cape