Error Adding Buttons To Message

I am working on creating an application system for my Discord server, but that is irrelevant to the issue. I am trying to add Flag and Deny buttons to the embed that is sent to the submitted applications channel. Here is my code:
const flag = new ButtonBuilder({
customId: 'flag',
label: 'Flag',
style: ButtonStyle.Secondary,
emoji: '👋'
})

const deny = new ButtonBuilder({
customId: 'deny',
label: 'Deny',
style: ButtonStyle.Secondary,
emoji: '🙁'
})

const row = new ActionRowBuilder<ButtonBuilder>().addComponents([flag, deny])
await applicationsChannel.send({ embeds: [embed], components: [row] });
const flag = new ButtonBuilder({
customId: 'flag',
label: 'Flag',
style: ButtonStyle.Secondary,
emoji: '👋'
})

const deny = new ButtonBuilder({
customId: 'deny',
label: 'Deny',
style: ButtonStyle.Secondary,
emoji: '🙁'
})

const row = new ActionRowBuilder<ButtonBuilder>().addComponents([flag, deny])
await applicationsChannel.send({ embeds: [embed], components: [row] });
Here is the error that I am getting:
Type 'ActionRowBuilder<ButtonBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
Property 'type' is missing in type 'ActionRowBuilder<ButtonBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.
Type 'ActionRowBuilder<ButtonBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
Property 'type' is missing in type 'ActionRowBuilder<ButtonBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.
I have been at this for over 2 days now can still can't figure a fix out. I am using DJS version 14.15.3 and Node version 21.6.2. Thanks!
3 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - 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! - Marked as resolved by OP
koholaz
koholazOP3mo ago
├─┬ @discordjs/[email protected]
│ ├─┬ @discordjs/[email protected]
│ │ └── [email protected] deduped
│ └── [email protected]
├─┬ @discordjs/[email protected]
│ └── [email protected] deduped
├─┬ @discordjs/[email protected]
│ └── [email protected]
├─┬ @discordjs/[email protected]
│ └── [email protected] deduped
├─┬ @discordjs/[email protected]
│ ├─┬ @discordjs/[email protected]
│ │ └── [email protected] deduped
│ └── [email protected]
├─┬ @discordjs/[email protected]
│ └── [email protected] deduped
├─┬ @discordjs/[email protected]
│ └── [email protected]
├─┬ @discordjs/[email protected]
│ └── [email protected] deduped
when i tried, it broke my entire code so i just reverted it oh... so just npm install discord.js@latest? sorry im a bit new to discord.js and typescript in genearl well it fixed the buttons i think, but ill have to go in and fix the commands, thank god i only have 4 rn that wouldve been a hassle if i did this last 😭 thank you so much, let me test this rq
koholaz
koholazOP3mo ago
its perfect, thanks!
No description
Want results from more Discord servers?
Add your server