From 694d6a2bba04abc55b8ec8ae6e56ea505c3b0e90 Mon Sep 17 00:00:00 2001 From: diamondburned Date: Sat, 29 May 2021 21:30:20 -0700 Subject: [PATCH] gateway: Clarify field presence for InteractionCreateEvent --- gateway/events.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gateway/events.go b/gateway/events.go index 4690cd8..7b3fbb4 100644 --- a/gateway/events.go +++ b/gateway/events.go @@ -375,13 +375,17 @@ type ( AppID discord.AppID `json:"application_id"` Type InteractionType `json:"type"` Data *InteractionData `json:"data,omitempty"` - GuildID discord.GuildID `json:"guild_id,omitempty"` ChannelID discord.ChannelID `json:"channel_id,omitempty"` - Member *discord.Member `json:"member,omitempty"` - User *discord.User `json:"user,omitempty"` Token string `json:"token"` Version int `json:"version"` Message *discord.Message `json:"message"` + + // Member is only present if this came from a guild. + Member *discord.Member `json:"member,omitempty"` + GuildID discord.GuildID `json:"guild_id,omitempty"` + + // User is only present if this didn't come from a guild. + User *discord.User `json:"user,omitempty"` } )