Editing a button issue
So im basically trying to make a slash command that edits one of 2 buttons in Embed Message. And after invoking command, it throws this error:
components[0].components[BASE_TYPE_BAD_LENGTH]: Must be between 1 and 1521 in length.
at message.edit()
How I can do that in a correct way? Is that even possible?
Here's my code:
5 Replies
• 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.Use the ButtonStyle enum instead of "SUCCESS" or "DANGER"
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined
- All SCREAMING_SNAKE_CASE
enums have been changed to PascalCase
- Intents: Intents.FLAGS.GUILD_MESSAGES
-> GatewayIntentBits.GuildMessages
- Permissions: Permissions.FLAGS.SEND_MESSAGES
-> PermissionFlagsBits.SendMessages
Also modifying the button on the existing message object is a bad idea because you're intentionally making your cache desynced. Better to clone it with a new ButtonBuilder
ok then I will do that