kps
kps
DIAdiscord.js - Imagine an app
Created by kps on 8/31/2024 in #djs-questions
Can't send modals ( An error occured )
Hi, i'm getting an error while sending modals code:
if(interaction.type === InteractionType.ModalSubmit) {
console.log(interaction)
if((interaction as ModalSubmitInteraction).customId === "modal-contact-admin") {
console.log((interaction as ModalSubmitInteraction).fields.getField("modal-input-admin").value)
}
if(interaction.type === InteractionType.ModalSubmit) {
console.log(interaction)
if((interaction as ModalSubmitInteraction).customId === "modal-contact-admin") {
console.log((interaction as ModalSubmitInteraction).fields.getField("modal-input-admin").value)
}
Error : An error occured | directly on the modal I receive the interaction correctly, seems he cant handle it.
37 replies
DIAdiscord.js - Imagine an app
Created by kps on 8/27/2024 in #djs-questions
Can't create a modal component
Hi, Getting this error whil creating a modal component
Argument of type '[ActionRowBuilder<AnyComponentBuilder>]' is not assignable to parameter of type 'RestOrArray<ActionRowBuilder<TextInputBuilder>>'.
Type '[ActionRowBuilder<AnyComponentBuilder>]' is not assignable to type '[ActionRowBuilder<TextInputBuilder>[]]'.
Type 'ActionRowBuilder<AnyComponentBuilder>' is missing the following properties from type 'ActionRowBuilder<TextInputBuilder>[]': length, pop, push, concat, and 29 more.ts(2345)
Argument of type '[ActionRowBuilder<AnyComponentBuilder>]' is not assignable to parameter of type 'RestOrArray<ActionRowBuilder<TextInputBuilder>>'.
Type '[ActionRowBuilder<AnyComponentBuilder>]' is not assignable to type '[ActionRowBuilder<TextInputBuilder>[]]'.
Type 'ActionRowBuilder<AnyComponentBuilder>' is missing the following properties from type 'ActionRowBuilder<TextInputBuilder>[]': length, pop, push, concat, and 29 more.ts(2345)
const modal = new ModalBuilder()
.setCustomId(`modal-create-${ticketType}-`)
.setTitle(`title`)
.setComponents(
new ActionRowBuilder().setComponents(
new TextInputBuilder()
.setCustomId("modal-input-input")
.setLabel(`What would you like to say to us ?`)
.setStyle(TextInputStyle.Paragraph)
)
)

await interaction.showModal(modal);
const modal = new ModalBuilder()
.setCustomId(`modal-create-${ticketType}-`)
.setTitle(`title`)
.setComponents(
new ActionRowBuilder().setComponents(
new TextInputBuilder()
.setCustomId("modal-input-input")
.setLabel(`What would you like to say to us ?`)
.setStyle(TextInputStyle.Paragraph)
)
)

await interaction.showModal(modal);
4 replies
DIAdiscord.js - Imagine an app
Created by kps on 8/27/2024 in #djs-questions
Enum Integer Permissions Typescript
Hi there all, is there a "Enum" type in the package or anything one that returns integer permissions with a PermissionResolvable type ? Sorry if my question is not at the right place.
12 replies