diff --git a/structs.go b/structs.go index e811e9e..5dde7aa 100644 --- a/structs.go +++ b/structs.go @@ -316,7 +316,7 @@ type Presence struct { type Game struct { Name string `json:"name"` Type int `json:"type"` - URL string `json:"url"` + URL string `json:"url,omitempty"` } // UnmarshalJSON unmarshals json to Game struct diff --git a/wsapi.go b/wsapi.go index baec234..ab37b5a 100644 --- a/wsapi.go +++ b/wsapi.go @@ -250,8 +250,10 @@ func (s *Session) heartbeat(wsConn *websocket.Conn, listening <-chan interface{} } type updateStatusData struct { - IdleSince *int `json:"idle_since"` - Game *Game `json:"game"` + IdleSince *int `json:"since"` + Game *Game `json:"game"` + AFK bool `json:"afk"` + Status string `json:"status"` } type updateStatusOp struct { @@ -274,7 +276,10 @@ func (s *Session) UpdateStreamingStatus(idle int, game string, url string) (err return ErrWSNotFound } - var usd updateStatusData + usd := updateStatusData{ + Status: "online", + } + if idle > 0 { usd.IdleSince = &idle }