#BaseMessageOptions#components does not take Builders

1 messages · Page 1 of 1 (latest)

quick veldt
#

Hey everyone, so I've just downloaded djs 14.7.0 and i'm migrating my bot.
I used to have a few .send({ components: [myComp] }), where myComp was the equivalent of what is now a Builder. So now i've updated it to a builder, but it is no longer accepted by TypeScript. A few examples:

src/commands/General/code.ts:169:86 - 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<MessageActionRowComponentData | MessageActionRowComponentBuilder>'.

169     await prompter.send({ components: [codeMenu(codes)] });
src/commands/General/code.ts:211:20 - error TS2322: Type 'ActionRowBuilder<AnyComponentBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.

211       components: [wrapConfirmation],

How can I solve this?
Calling .data or .toJSON() does not solve the issue

Thanks!

potent ventureBOT
#

@quick veldt to help others find answers, you can mark your question as solved via Right Click Solution Message->Apps->✅ Mark Solution

quick veldt
#

Found it, my action rows need to have a generic set, i cannot use the broad ActionRowBuilder.

potent ventureBOT
#

Thank you for marking this question as solved!

Question Message ID

1063211422676434984

Solution Message ID

1063213068315787344