Skip to content

RESTPatchAPIWebhookWithTokenMessageJSONBody omitting flags property #1292

@nlwillia

Description

@nlwillia

Issue description

The RESTPatchAPIWebhookWithTokenMessageJSONBody type does not pick "flags", but flags seem to be required to avoid a 400 on component payloads.

This is just using the types for direct REST requests. I can work around the TS error on an unexpected property, but it's a mild nuisance.

Code sample

In the REST interaction response exchange involving:

POST .../interactions/${interaction_id}/${interaction_token}/callback
PATCH .../webhooks/${application_id}/${interaction_token}/messages/@original

I believe that `RESTPatchAPIWebhookWithTokenMessageJSONBody` is the body of the patch request, but the type does not allow flags, and flags seem to be required to avoid a 400 error.


{
            flags: MessageFlags.IsComponentsV2, // TS2353: Object literal may only specify known properties, and flags does not exist in type RESTPatchAPIWebhookWithTokenMessageJSONBody
            components: [...]
}

Package version

0.38.13

Runtime

Node.js

Runtime version

node v20.19.0, TypeScript v5.8.3

Priority this issue should have

Low (slightly annoying)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions