#TypeError Cannot read properties of undefined (reading 0)

1 messages · Page 1 of 1 (latest)

scenic pecan
#

You have to call values

#

Then access it as array

prisma mural
#

let values = interaction?

#

idk

scenic pecan
#

If you read your error, you can see there's something wrong about that 0

#

That is where you have to look at

prisma mural
#

it's that the dropdown menu works fine, the buttons don't, and I don't know what to do

fading sequoia
#

values isn't a property on button interactions? Unless I'm mistaken

#

Definitely doesn't appear as such

prisma mural
#

hmu

fading sequoia
#

In the error

#

What are you trying to do

prisma mural
#

so is:

coletor.on('collect', async (collected) => {
                if (collected.user.id !== interaction.user.id) return

                let menu = collected.customId[0]
                collected.deferUpdate()


                if (menu === "galinha") {
#

I'll log

#

nothing is logged

#
coletor.on('collect', async (collected) => {
                if (collected.user.id !== interaction.user.id) return

                let menu = collected.custumId[0]
                console.log(collected)
                collected.deferUpdate()


                if (menu === "galinha") {```
fading sequoia
#

Okay first off

#

custumId doesn't exist on a button interaction

#

I think you meant

#

customId

#

Then try

#

also

#

menu will never equal galinha

#

Because in your code you're indexing then first char of the string

#

I think you probably want to remove the [0] after the customId

prisma mural
#

ok

#

i'll try