#Interactive Button Data

2 messages · Page 1 of 1 (latest)

spring lynx
#

I want to make my Button label interactive but somehow it doesnt change when the variable changes:

const el = {power:"on"};

const bt = new Button({get label(){
return el.power
},...}) //Button extends ButtonBuilder
el.power = "off";
await interaction.reply({components: toComponents( bt) })

I am sure its because the props are not directly linked to Buttonbuilder.data but just set once when initating the class right? Is there some way to fix that?

acoustic stormBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!