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

Fix ModalSubmitInteraction Typings #7768

Merged
merged 1 commit into from Apr 19, 2022

Conversation

sasial-dev
Copy link

Please describe the changes this PR makes and why it should be merged:

Fix typings not existing for already existing code.

https://github.com/discordjs/discord.js/blob/v13/src/structures/ModalSubmitInteraction.js#L47-L51

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@github-actions github-actions bot added the chore label Apr 11, 2022
@sasial-dev sasial-dev changed the base branch from main to v13 April 11, 2022 10:22
@almeidx
Copy link
Member

almeidx commented Apr 11, 2022

I believe it should not have a message property at all

https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure

for components

@Jiralite
Copy link
Member

Jiralite commented Apr 11, 2022

I believe it should not have a message property at all

https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure

for components

Modals do receive the payload if it was from a component!
{
  t: 'INTERACTION_CREATE',
  s: 4,
  op: 0,
  d: {
    version: 1,
    type: 5,
    token: 'token',
    message: {
      type: 0,
      tts: false,
      timestamp: '2022-02-16T19:09:35.384000+00:00',
      pinned: false,
      mentions: [],
      mention_roles: [],
      mention_everyone: false,
      id: '943584917885960303',
      flags: 0,
      embeds: [],
      edited_timestamp: null,
      content: 'Do you have any feedback for us? Do you wish to alert us of misbehaviour within the friends chat or Discord server? <#942814460769366057> is the place to be!\n' +
        '\n' +
        "If you are attempting to report an ongoing situation that needs immediate attention, feel free to mention the <@&886323824822456357> role and we'll respond accordingly.\n" +
        '\n' +
        'Please interact with the respective button to get started!',
      components: [Array],
      channel_id: '942814460769366057',
      author: [Object],
      attachments: []
    },
    member: {
      user: [Object],
      roles: [Array],
      premium_since: null,
      permissions: '4398046511103',
      pending: false,
      nick: null,
      mute: false,
      joined_at: '2021-09-11T18:54:26.945000+00:00',
      is_pending: false,
      flags: 0,
      deaf: false,
      communication_disabled_until: null,
      avatar: null
    },
    locale: 'en-GB',
    id: '963055469386149944',
    guild_locale: 'en-US',
    guild_id: '886323824801488996',
    data: { custom_id: 'MAIL_SOULOBBY_REPORT', components: [Array] },
    channel_id: '942814460769366057',
    application_id: '559093467264057344'
  }
}

This pull request is a backport of #7705 anyhow and needs amending.

typings/index.d.ts Outdated Show resolved Hide resolved
@Jiralite
Copy link
Member

Jiralite commented Apr 12, 2022

Hi @sasial-dev, can you look at #7705 and made the necessary changes here? It should match! Seems there is only one change left to do.

@sasial-dev
Copy link
Author

sasial-dev commented Apr 13, 2022

According to my local copy, the 2nd change in #7705 already exists!

@Jiralite
Copy link
Member

Jiralite commented Apr 13, 2022

You need to modify this:

message: GuildCacheMessage<Cached> | null;

@sasial-dev
Copy link
Author

sasial-dev commented Apr 14, 2022

@Jiralite
Copy link
Member

I said you need to modify it! Look at the upstream pull request and compare.

@sasial-dev sasial-dev force-pushed the typings/v13/ModalSubmitInteraction branch from 1563bb5 to afdb34d Compare April 14, 2022 01:35
@sasial-dev
Copy link
Author

Apologies for the misunderstanding - all sorted :)

@sasial-dev
Copy link
Author

sasial-dev commented Apr 14, 2022

Stuffed up the rebase, sorry.

@sasial-dev sasial-dev force-pushed the typings/v13/ModalSubmitInteraction branch from fb40118 to afdb34d Compare April 14, 2022 06:38
@sasial-dev sasial-dev force-pushed the typings/v13/ModalSubmitInteraction branch from afdb34d to 5dfffc7 Compare April 15, 2022 04:02
@sasial-dev
Copy link
Author

^ Rebased through Github UI, seemed to have fixed it (but didn't sign)

@sasial-dev
Copy link
Author

@Mateo-tem, can you re-review?

@iCrawl iCrawl merged commit 1d09ad4 into discordjs:v13 Apr 19, 2022
@sasial-dev sasial-dev deleted the typings/v13/ModalSubmitInteraction branch April 20, 2022 01:41
@RedGuy12 RedGuy12 mentioned this pull request Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

7 participants