Can't assign ActionRowBuilder to components #8517
-
I'm having an issue with Discord.js v14 where I don't seem to be able to add an action row to a message, despite (AFAIK) doing exactly as the guide says to do. Error:
Code: const actRow = new ActionRowBuilder().addComponents(
new ButtonBuilder({
customId: "accept",
label: "Accept",
style: ButtonStyle.Primary,
}),
// snip two more buttons
);
const msg = (await receivingUser.send({
content: `${userMention(sendingUser)} has sent you a YAML. Please review it and choose if you'd like to add it to your collection.`,
files: [{ attachment: Buffer.from(yamlData.data) }],
components: [actRow] // here is the error
})); This error happens in every spot in the code where I try to add components to messages or interaction responses. Using Node v18.7.0 and Discord.js v14.2.0. |
Beta Was this translation helpful? Give feedback.
Answered by
Jiralite
Aug 18, 2022
Replies: 1 comment 1 reply
-
I assume you're reading from https://discordjs.guide/interactions/buttons.html since I see buttons. There is one thing you are not doing which is dictated for TypeScript users: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
kyranet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I assume you're reading from https://discordjs.guide/interactions/buttons.html since I see buttons. There is one thing you are not doing which is dictated for TypeScript users: