Max
Max
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Max on 7/28/2023 in #djs-questions
ActionRowBuilder type in interaction.reply component
Hello, I'm creating a typescript discord handler and want to try the buttons, however I have a typing error. I looked at the doc and it's well written. Do you have a solution to my problem? note: the CommandContext is the same as the ChatInputInteractionCommand, but with additional methods, the reply method is a copy with the same options as in the package.
execute(client: ExtendsClient, ctx: CommandContext) {
const click = new ButtonBuilder()
.setCustomId("btn1")
.setLabel("Click")
.setStyle(ButtonStyle.Primary)

const row = new ActionRowBuilder()
.addComponents(click);
ctx.reply({content: "Click sur le bouton pour essayer l'event :", components: [row]})
}
execute(client: ExtendsClient, ctx: CommandContext) {
const click = new ButtonBuilder()
.setCustomId("btn1")
.setLabel("Click")
.setStyle(ButtonStyle.Primary)

const row = new ActionRowBuilder()
.addComponents(click);
ctx.reply({content: "Click sur le bouton pour essayer l'event :", components: [row]})
}
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>'.
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>'.
8 replies
DIAdiscord.js - Imagine an app
Created by Max on 1/14/2023 in #djs-questions
error undefined slash cmd
10 replies