Skip to content

Commit

Permalink
feat(Message): add InteractionMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
FedorLap2006 committed Jun 20, 2024
1 parent d2b5cda commit f18be4c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,14 @@ type Message struct {
// If the field exists but is null, the referenced message was deleted.
ReferencedMessage *Message `json:"referenced_message"`

// Deprecated, use InteractionMetadata.
// Is sent when the message is a response to an Interaction, without an existing message.
// This means responses to message component interactions do not include this property,
// instead including a MessageReference, as components exist on preexisting messages.
Interaction *MessageInteraction `json:"interaction"`

InteractionMetadata *MessageInteractionMetadata `json:"interaction_metadata"`

// The flags of the message, which describe extra features of a message.
// This is a combination of bit masks; the presence of a certain permission can
// be checked by performing a bitwise AND between this int and the flag.
Expand Down Expand Up @@ -567,3 +570,14 @@ type MessageInteraction struct {
// Member is only present when the interaction is from a guild.
Member *Member `json:"member"`
}

// MessageInteractionMetadata contains metadata of an interaction, including relevant user info.
type MessageInteractionMetadata struct {
ID string `json:"id"`
Type InteractionType `json:"type"`
User *User `json:"user"`
AuthorizingIntegrationOwners map[ApplicationIntegrationType]string `json:"authorizing_integration_owners"`
OriginalResponseMessageID string `json:"original_response_message_id,omitempty"`
InteractedMessageID string `json:"interacted_message_id,omitempty"`
TriggeringInteractionMetadata *MessageInteractionMetadata `json:"triggering_interaction_metadata,omitempty"`
}

0 comments on commit f18be4c

Please sign in to comment.