From 4906a4cf9c6b2d536143d8db31c278be1589a52c Mon Sep 17 00:00:00 2001 From: jonas747 Date: Sun, 24 Apr 2016 23:35:37 +0200 Subject: [PATCH 1/4] Added some undocumented fields to ready event --- structs.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/structs.go b/structs.go index 7ca71a6..e17923c 100644 --- a/structs.go +++ b/structs.go @@ -277,6 +277,19 @@ type Ready struct { ReadState []*ReadState `json:"read_state"` PrivateChannels []*Channel `json:"private_channels"` Guilds []*Guild `json:"guilds"` + + // Undocumented fields + Settings *Settings `json:"user_settings"` + UserGuildSettings []*UserGuildSettings `json:"user_guild_settings"` + Relationships []*Relationship `json:"relationships"` + Presences []*Presence `json:"presences"` +} + +// A Relationship between the current user and this user +type Relationship struct { + User *User `json:"user"` + Type int `json:"type"` // ? + Id string `json:"id"` // Seems to be same as the User.ID? } // A RateLimit struct holds information related to a specific rate limit. From 88c37e75a114ac823f7d6aedd9cdaffa921b7df3 Mon Sep 17 00:00:00 2001 From: jonas747 Date: Mon, 25 Apr 2016 00:56:51 +0200 Subject: [PATCH 2/4] Figured out relationship type --- structs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/structs.go b/structs.go index e17923c..8b9e7a1 100644 --- a/structs.go +++ b/structs.go @@ -285,11 +285,11 @@ type Ready struct { Presences []*Presence `json:"presences"` } -// A Relationship between the current user and this user +// A Relationship between the logged in user and Relationship.User type Relationship struct { User *User `json:"user"` - Type int `json:"type"` // ? - Id string `json:"id"` // Seems to be same as the User.ID? + Type int `json:"type"` // 1 = friend, 2 = blocked, 3 = incoming friend req, 4 = sent friend req + Id string `json:"id"` } // A RateLimit struct holds information related to a specific rate limit. From 339ad583da930547e0f90e012c2478299ee83f98 Mon Sep 17 00:00:00 2001 From: jonas747 Date: Mon, 25 Apr 2016 00:59:03 +0200 Subject: [PATCH 3/4] Changed Id to ID per iopreds request --- structs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/structs.go b/structs.go index 8b9e7a1..00aab28 100644 --- a/structs.go +++ b/structs.go @@ -289,7 +289,7 @@ type Ready struct { type Relationship struct { User *User `json:"user"` Type int `json:"type"` // 1 = friend, 2 = blocked, 3 = incoming friend req, 4 = sent friend req - Id string `json:"id"` + ID string `json:"id"` } // A RateLimit struct holds information related to a specific rate limit. From 82ac29f0bc5358a56270c3285d531d17b124d1b1 Mon Sep 17 00:00:00 2001 From: jonas747 Date: Mon, 25 Apr 2016 03:30:12 +0200 Subject: [PATCH 4/4] Updated settings struct --- structs.go | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/structs.go b/structs.go index 7ca71a6..de43f65 100644 --- a/structs.go +++ b/structs.go @@ -248,14 +248,25 @@ type User struct { // A Settings stores data for a specific users Discord client settings. type Settings struct { - RenderEmbeds bool `json:"render_embeds"` - InlineEmbedMedia bool `json:"inline_embed_media"` - EnableTtsCommand bool `json:"enable_tts_command"` - MessageDisplayCompact bool `json:"message_display_compact"` - ShowCurrentGame bool `json:"show_current_game"` - Locale string `json:"locale"` - Theme string `json:"theme"` - MutedChannels []string `json:"muted_channels"` + RenderEmbeds bool `json:"render_embeds"` + InlineEmbedMedia bool `json:"inline_embed_media"` + InlineAttachmentMedia bool `json:"inline_attachment_media"` + EnableTtsCommand bool `json:"enable_tts_command"` + MessageDisplayCompact bool `json:"message_display_compact"` + ShowCurrentGame bool `json:"show_current_game"` + Locale string `json:"locale"` + Theme string `json:"theme"` + + RestrictedGuilds []string `json:"restricted_guilds"` + AllowEmailFriendRequest bool `json:"allow_email_friend_request"` + ConvertEmoticons bool `json:"convert_emoticons"` + FriendSourceFlags *FriendSourceFlags `json:"friend_source_flags"` +} + +type FriendSourceFlags struct { + All bool `json:"all"` + MutualGuilds bool `json:"mutual_guilds"` + MutualFriends bool `json:"mutual_friends"` } // An Event provides a basic initial struct for all websocket event.