From fca953d13a23d5a4255e57ba107000eb651d93da Mon Sep 17 00:00:00 2001 From: mlnrDev Date: Thu, 1 Feb 2024 13:30:01 +0100 Subject: [PATCH] Add MentionChannel so crossposted messages can actually unmarshal :-) --- discord/message.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/discord/message.go b/discord/message.go index d6c0a065..e7a0ff7c 100644 --- a/discord/message.go +++ b/discord/message.go @@ -92,7 +92,7 @@ type Message struct { Mentions []User `json:"mentions"` MentionEveryone bool `json:"mention_everyone"` MentionRoles []snowflake.ID `json:"mention_roles"` - MentionChannels []Channel `json:"mention_channels"` + MentionChannels []MentionChannel `json:"mention_channels"` Pinned bool `json:"pinned"` EditedTimestamp *time.Time `json:"edited_timestamp"` Author User `json:"author"` @@ -335,6 +335,13 @@ func (m Message) JumpURL() string { return fmt.Sprintf(MessageURLFmt, guildID, m.ChannelID, m.ID) // duplicate code, but there isn't a better way without sacrificing user convenience } +type MentionChannel struct { + ID snowflake.ID `json:"id"` + GuildID snowflake.ID `json:"guild_id"` + Type ChannelType `json:"type"` + Name string `json:"name"` +} + type MessageThread struct { GuildThread Member ThreadMember `json:"member"`