Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

application modal throws invalid interaction after upgrade #43

Open
santgr11 opened this issue Sep 13, 2023 · 1 comment
Open

application modal throws invalid interaction after upgrade #43

santgr11 opened this issue Sep 13, 2023 · 1 comment

Comments

@santgr11
Copy link

I was using 3.2.0, in one place I return an APPLICATION_MODAL, after upgrading to 3.4.0 the interaction returning the 200 with the exact same component throws invalid interacion in discord.

Im returning the component like this:

{
  type: InteractionResponseType.APPLICATION_MODAL,
  data: {
    title: 'Insert code.',
    custom_id: 'associate-code',
    components: [
      {
        type: 1,
        components: [
          {
            type: 4,
            custom_id: 'associate-code',
            label: 'Associate Code',
            style: 2,
            min_length: 12,
            max_length: 12,
            placeholder: 'Insert code',
            required: true
          }
        ]
      }
    ]
  }
}
@Waxo
Copy link

Waxo commented Nov 12, 2023

There was a good clue in your question.

InteractionResponseType.APPLICATION_MODAL doesn't exist anymore you should use InteractionResponseType.MODAL (https://github.com/discord/discord-interactions-js/blob/955d77b857dc798f46914cd2b9e4bf59de429f8f/src/index.ts#L61C7-L61C7)

Docs should be updated too (https://github.com/discord/discord-interactions-js/blob/main/examples/modal_example.js) can make an PR if needed and still maintained

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants