#No interactionCreate in Forum
1 messages · Page 1 of 1 (latest)
We already tried to :
- console.log when new interaction, only log when it's the button, but the modal don't log (console.log was a the top)
version?
14.4
you recieve the interaction?
Nop, that is the problem
I only recieve the button
(and the button is logged)
- forms from GuildText work perfectly
The problem i think its , Tweenty doesnt receive the ModalSubmitInteraction in the interactionCreate event.
they receive ButtonInteraction but not ModalSubmitInteraction , am i right ?
works fine for me too
So it's a problem with their handler
@kind phoenix maybe you didn't register the modal in client.modal
Yup
@tender marten
With a modal ?
like with what
Are you using the correct key to get it?
There is no interaction so the code just doesn't reach anything
is there an execption before running execute of that file?
nothing
yes
ChatInputCommandInteraction
Oh maybe it's why it works, gonna check !
It works for me too
It's a button issue 🤔
works fine on buttons too
I deleted it after trying ._.
ah xd
but basically I've created a button in a message
in the interactionCreate event I built the modal and used showModal
still in interactionCreate I used reply() when receiving the modal
I do this little code and there is no interaction for the modal wtf
export default {
data: {
name: "interactionCreate",
once: false,
},
async execute(client, interaction) {
if (interaction.isButton()) {
const modal = new ModalBuilder()
.setCustomId("test")
.setTitle("Test");
const field = new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId("field")
.setLabel("Test field")
.setStyle(TextInputStyle.Paragraph)
);
modal.addComponents([field]);
return await interaction.showModal(modal);
}
if (interaction.isModalSubmit()) {
return await interaction.followUp("Done")
}
},
};``` I really don't have any idea :|
Strange, I have the same issue, ´interaction.isModalSubmit() doesn't trigger.
I have a command via context menu, it's working fine in threads and normal channels, but not in forum posts/threads
weird
everything works fine for me ._.
With this code 🤔 ? (if u can try with this)
it seems like the issue is coming from you ._.
and it worked?
rip ._.
can you show your handler
Where I register my events, or where interactionCreate is "manage" ?
both please
"Manage" - Example for the test :
export default {
data: {
name: "interactionCreate",
once: false,
},
async execute(client, interaction) {
if (interaction.isButton()) {
const modal = new ModalBuilder()
.setCustomId("test")
.setTitle("Test");
const field = new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId("field")
.setLabel("Test field")
.setStyle(TextInputStyle.Paragraph)
);
modal.addComponents([field]);
return await interaction.showModal(modal);
}
if (interaction.isModalSubmit()) {
return await interaction.followUp("Done")
}
},
};```
Register :
```js
client.loadFile = ({ type, path }, file) => {
try {
import(`file://${file}`).then(({ default: CommandOrEvent }) => {
const name = CommandOrEvent.data.name;
client.log("info", `Fichier de type ${type} : ${name} a été chargé.`);
client[type].set(name, CommandOrEvent);
if (type === "events") {
const event = CommandOrEvent;
if (event.data.once) {
client.once(event.data.name, (...args) =>
event.execute(client, ...args)
);
} else {
client.on(event.data.name, (...args) =>
event.execute(client, ...args)
);
}
}
});
} catch ({ message }) {
return `Impossible de charger le fichier ${file} : \n${message}`;
}
};```
If someone want to try :
https://sourceb.in/HGD4lCyOCQ - Edited
you can't use followup without replying/deferring before
I had forgotten how it is done automatically in my code :') but it doesn't change the problem anyway, I edit the file
Add a console.log(interaction) in interactionCreate first thing and show the output please
There is no interaction, that is the problem xd
In your one-page bot?
Yes, it's just a test
Dans there is no interaction when it's the modal
But, when it's the button, it's okay 
npm ls discord-api-types shows what?
test@1.0.0 C:\Users\Tweenty\Desktop\test
+-- discord-api-types@0.37.10
`-- discord.js@14.4.0
+-- @discordjs/builders@1.2.0
| `-- discord-api-types@0.37.10 deduped
+-- @discordjs/rest@1.1.0
| `-- discord-api-types@0.37.10 deduped
`-- discord-api-types@0.37.10 deduped
Why do you have discord-api-types installed manually?
discord.js re-exports them all, just import from there
In fact webstorm does not automatically "export enums", like ButtonStyle for example, it's just to have some color on it
Yeah, webstorm is bad at handling types. Either deal with it or use an IDE that can handle it
The error is wrong, it actually does work when running
Yes I know x)
I just install the package "manually" on my IDE but I don't put it in production
Where do you test your one-page bot? Where did you run that npm command?
Where do you test your one-page bot? - In my private server 🤔 ?
Where did you run that npm command? For install modules ? In the terminal ?
No, I meant do you run the node process in your dev environment with the manually installed dapi-types package etc? Did you try running it with only discord.js as dependency?
I just uninstalled api-types, I deleted node_modules and package-lock, I reinstalled everything cleanly and it doesn't change anything
lemme see if I can reproduce
Yup
Cause Idris can't reproduce with the same code lmao
And Amon has the same problem 
Oh yes
It's a "mid view" problem, nice gonna check on discord
or just submit a bug in https://dis.gd/bugreport
Thanks
Np
only for forum threads
@tender marten A7mooz found the problem and it was simply that in split screen it doesn't work xD
?
