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 != "" {
|
||||
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
|
||||
|
|
16
structs.go
16
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue