#No interactionCreate in Forum

1 messages · Page 1 of 1 (latest)

kind phoenix
#

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)
sharp panther
#

version?

kind phoenix
#

14.4

sharp panther
#

you recieve the interaction?

kind phoenix
#

Nop, that is the problem

#

I only recieve the button

#

(and the button is logged)

  • forms from GuildText work perfectly
abstract anchor
#

works fine for me

#

my bot is able to reply in a thread in a forum channel

void lava
#

The problem i think its , Tweenty doesnt receive the ModalSubmitInteraction in the interactionCreate event.

#

they receive ButtonInteraction but not ModalSubmitInteraction , am i right ?

sharp panther
#

So it's a problem with their handler

#

@kind phoenix maybe you didn't register the modal in client.modal

kind phoenix
#

Gonna check !

#

He's in the collection

kind phoenix
sharp panther
#

like with what

sharp panther
kind phoenix
#

There is no interaction so the code just doesn't reach anything

sharp panther
#

is there an execption before running execute of that file?

kind phoenix
#

nothing

abstract anchor
kind phoenix
#

wut

#

With a button interaction before Kappa ?

abstract anchor
#

ChatInputCommandInteraction

kind phoenix
#

Oh maybe it's why it works, gonna check !

#

It works for me too

#

It's a button issue 🤔

abstract anchor
kind phoenix
#

wtf

#

Can you send me your code for the command @abstract anchor ? (just gonna try)

abstract anchor
kind phoenix
#

ah xd

abstract anchor
#

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

kind phoenix
#

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 :|
tender marten
#

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

abstract anchor
#

weird
everything works fine for me ._.

kind phoenix
#

With this code 🤔 ? (if u can try with this)

kind phoenix
#

Cheat

#

:k

abstract anchor
#

it seems like the issue is coming from you ._.

kind phoenix
#

wtf

#

I delete my package-lock, nodemodules, idk

abstract anchor
#

and it worked?

kind phoenix
#

no

#

xd

abstract anchor
#

rip ._.

abstract anchor
kind phoenix
abstract anchor
#

both please

kind phoenix
#

"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}`;
    }
  };```
kind phoenix
#

Just gonna try a "one page bot" omegabalkanylul

#

Same with "one page bot" KaPOP

kind phoenix
sharp panther
kind phoenix
#

I had forgotten how it is done automatically in my code :') but it doesn't change the problem anyway, I edit the file

honest brook
kind phoenix
#

There is no interaction, that is the problem xd

honest brook
#

In your one-page bot?

kind phoenix
#

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 KaPOP

honest brook
#

npm ls discord-api-types shows what?

kind phoenix
#
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
honest brook
#

Why do you have discord-api-types installed manually?

#

discord.js re-exports them all, just import from there

kind phoenix
#

In fact webstorm does not automatically "export enums", like ButtonStyle for example, it's just to have some color on it

honest brook
#

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

kind phoenix
#

Yes I know x)

#

I just install the package "manually" on my IDE but I don't put it in production

honest brook
#

Where do you test your one-page bot? Where did you run that npm command?

kind phoenix
#

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 ?

honest brook
#

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?

kind phoenix
#

I just uninstalled api-types, I deleted node_modules and package-lock, I reinstalled everything cleanly and it doesn't change anything

sharp panther
#

lemme see if I can reproduce

kind phoenix
#

Yup

#

Cause Idris can't reproduce with the same code lmao

#

And Amon has the same problem KaPOP

sharp panther
#

Reproducible

#

If you don't view the thread in full view

#

that's a discord problem

kind phoenix
#

Oh yes

sharp panther
kind phoenix
#

It's a "mid view" problem, nice gonna check on discord

sharp panther
kind phoenix
#

Thanks

sharp panther
#

Np

sharp panther
kind phoenix
#

@tender marten A7mooz found the problem and it was simply that in split screen it doesn't work xD