Hey! I'm currently trying to make this code work:
import { EmbedBuilder, ActionRowBuilder, ButtonBuilder, MessageOptions } from "discord.js";
export function getMessage(): MessageOptions {
const embed = new EmbedBuilder().setTitle("Title").setDescription("Embed");
const button = new ButtonBuilder().setCustomId("button").setLabel("Button");
const row = new ActionRowBuilder().addComponents(button);
return {
embeds: [embed],
components: [row],
};
}
When I try this, I get a TypeScript Error:
src/features/tickets.ts(12,22): error TS2322: Type 'ActionRowBuilder<AnyComponentBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
Property 'type' is missing in type 'ActionRowBuilder<AnyComponentBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.
(The error is in the line where the components are being specified in the return)