#how to disable a button after a certain amt of time

36 messages · Page 1 of 1 (latest)

half kettle
#

how to disable a button after a certain amt of time

chrome gobletBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

half kettle
#

v14.2, node 18.7

#

m tryin to disble the button after 5s but it says interaction.messge... is not a function

half kettle
abstract dove
#

whats your error?

half kettle
abstract dove
#

Sorry, I misread your question

half kettle
#

oop

abstract dove
#

You will need to fetch the ActionRow, then fetch the Component

half kettle
#

interaction.actionrow(row.setDisabled())

#

smth like that? sry m new to this

abstract dove
#

<Interaction>.message.components[0].components[0].setDisabled(true)

#

The initial components property returns an array of ActionRows

#

Then you find the button from that ActionRow

half kettle
#

hm

abstract dove
#

Also, make sure you have the Message Content intent

half kettle
#

yes i have that enabled alr lemme try

half kettle
#

like

#

interaction.message.components[0].components[0]

#

this is returning my button

#

but m not able to update it

abstract dove
#

Ah. You need to override the ActionRow with a new one

#

So send the original action row, but with the button disabled

#

Then update the original interaction that sent the button

#

Have you read the guide by any chance?

half kettle
abstract dove
#

I suggest reading the edit section

half kettle
#

mk

jolly dawn
half kettle