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!
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
d-Iaa
discord.js - Imagine an app
Support server for discord.js, a Node.js module to interact with Discord's apps API.