diff --git a/state.go b/state.go index 38c92d0..d0c7b42 100644 --- a/state.go +++ b/state.go @@ -207,6 +207,15 @@ func (s *State) presenceAdd(guildID string, presence *Presence) error { if presence.Status != "" { guild.Presences[i].Status = presence.Status } + if presence.ClientStatus.Desktop != "" { + guild.Presences[i].ClientStatus.Desktop = presence.ClientStatus.Desktop + } + if presence.ClientStatus.Mobile != "" { + guild.Presences[i].ClientStatus.Mobile = presence.ClientStatus.Mobile + } + if presence.ClientStatus.Web != "" { + guild.Presences[i].ClientStatus.Web = presence.ClientStatus.Web + } //Update the optionally sent user information //ID Is a mandatory field so you should not need to check if it is empty diff --git a/structs.go b/structs.go index 5970ff4..97e82ae 100644 --- a/structs.go +++ b/structs.go @@ -1267,10 +1267,11 @@ type VoiceState struct { // A Presence stores the online, offline, or idle and game status of Guild members. type Presence struct { - User *User `json:"user"` - Status Status `json:"status"` - Activities []*Activity `json:"activities"` - Since *int `json:"since"` + User *User `json:"user"` + Status Status `json:"status"` + Activities []*Activity `json:"activities"` + Since *int `json:"since"` + ClientStatus ClientStatus `json:"client_status"` } // A TimeStamps struct contains start and end times used in the rich presence "playing .." Game @@ -1362,6 +1363,13 @@ func (m *Member) AvatarURL(size string) string { } +// ClientStatus stores the online, offline, idle, or dnd status of each device of a Guild member. +type ClientStatus struct { + Desktop Status `json:"desktop"` + Mobile Status `json:"mobile"` + Web Status `json:"web"` +} + // Status type definition type Status string