From a9064f5f4293ce45bb75e80c4d03456fadb658e8 Mon Sep 17 00:00:00 2001 From: sebm253 <42180891+sebm253@users.noreply.github.com> Date: Wed, 16 Oct 2024 21:18:00 +0200 Subject: [PATCH 1/2] Add InteractionMetadata target fields --- discord/message.go | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/discord/message.go b/discord/message.go index b4fddd58..d2b4902d 100644 --- a/discord/message.go +++ b/discord/message.go @@ -521,14 +521,23 @@ type RoleSubscriptionData struct { } type InteractionMetadata struct { - ID snowflake.ID `json:"id"` - Type InteractionType `json:"type"` - User User `json:"user"` - AuthorizingIntegrationOwners map[ApplicationIntegrationType]snowflake.ID `json:"authorizing_integration_owners"` - OriginalResponseMessageID *snowflake.ID `json:"original_response_message_id"` - Name *string `json:"name"` - InteractedMessageID *snowflake.ID `json:"interacted_message_id"` - TriggeringInteractionMetadata *InteractionMetadata `json:"triggering_interaction_metadata"` + ID snowflake.ID `json:"id"` + Type InteractionType `json:"type"` + User User `json:"user"` + AuthorizingIntegrationOwners map[ApplicationIntegrationType]snowflake.ID `json:"authorizing_integration_owners"` + OriginalResponseMessageID *snowflake.ID `json:"original_response_message_id"` + // This field will only be present for application command interactions of ApplicationCommandTypeUser. + // See https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-application-command-interaction-metadata-structure + TargetUser *User `json:"target_user"` + // This field will only be present for application command interactions of ApplicationCommandTypeMessage. + // See https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-message-command-interaction-metadata-structure + TargetMessageID *snowflake.ID `json:"target_message_id"` + // This field will only be present for InteractionTypeComponent interactions. + // See https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-message-component-interaction-metadata-structure + InteractedMessageID *snowflake.ID `json:"interacted_message_id"` + // This field will only be present for InteractionTypeModalSubmit interactions. + // See https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-modal-submit-interaction-metadata-structure + TriggeringInteractionMetadata *InteractionMetadata `json:"triggering_interaction_metadata"` } type MessageCall struct { From a2d7f91420218573502d75fad3a0c9556e596bd9 Mon Sep 17 00:00:00 2001 From: sebm253 <42180891+sebm253@users.noreply.github.com> Date: Tue, 5 Nov 2024 20:43:24 +0100 Subject: [PATCH 2/2] fix docs link --- discord/message.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/message.go b/discord/message.go index d2b4902d..f041c47b 100644 --- a/discord/message.go +++ b/discord/message.go @@ -530,7 +530,7 @@ type InteractionMetadata struct { // See https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-application-command-interaction-metadata-structure TargetUser *User `json:"target_user"` // This field will only be present for application command interactions of ApplicationCommandTypeMessage. - // See https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-message-command-interaction-metadata-structure + // See https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-application-command-interaction-metadata-structure TargetMessageID *snowflake.ID `json:"target_message_id"` // This field will only be present for InteractionTypeComponent interactions. // See https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-message-component-interaction-metadata-structure