Add Presence ClientStatus (#1303)
* Add ClientStatus struct * Add ClientStatus struct * Add comment * Update structs.go Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com> Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
This commit is contained in:
parent
f184824b8c
commit
2daab506b2
2 changed files with 21 additions and 4 deletions
9
state.go
9
state.go
|
@ -207,6 +207,15 @@ func (s *State) presenceAdd(guildID string, presence *Presence) error {
|
||||||
if presence.Status != "" {
|
if presence.Status != "" {
|
||||||
guild.Presences[i].Status = 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
|
//Update the optionally sent user information
|
||||||
//ID Is a mandatory field so you should not need to check if it is empty
|
//ID Is a mandatory field so you should not need to check if it is empty
|
||||||
|
|
|
@ -1271,6 +1271,7 @@ type Presence struct {
|
||||||
Status Status `json:"status"`
|
Status Status `json:"status"`
|
||||||
Activities []*Activity `json:"activities"`
|
Activities []*Activity `json:"activities"`
|
||||||
Since *int `json:"since"`
|
Since *int `json:"since"`
|
||||||
|
ClientStatus ClientStatus `json:"client_status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// A TimeStamps struct contains start and end times used in the rich presence "playing .." Game
|
// 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
|
// Status type definition
|
||||||
type Status string
|
type Status string
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue