Do not send game if one is not provided (instead of not sending game.name)
This commit is contained in:
parent
974d5862a4
commit
b5bfa454d0
1 changed files with 4 additions and 4 deletions
6
wsapi.go
6
wsapi.go
|
@ -60,12 +60,12 @@ func (s *Session) Handshake() (err error) {
|
|||
}
|
||||
|
||||
type updateStatusGame struct {
|
||||
Name *string `json:"name"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type updateStatusData struct {
|
||||
IdleSince *int `json:"idle_since"`
|
||||
Game updateStatusGame `json:"game"`
|
||||
Game *updateStatusGame `json:"game"`
|
||||
}
|
||||
|
||||
type updateStatusOp struct {
|
||||
|
@ -83,7 +83,7 @@ func (s *Session) UpdateStatus(idle int, game string) (err error) {
|
|||
usd.IdleSince = &idle
|
||||
}
|
||||
if game != "" {
|
||||
usd.Game.Name = &game
|
||||
usd.Game = &updateStatusGame{game}
|
||||
}
|
||||
|
||||
data := updateStatusOp{3, usd}
|
||||
|
|
Loading…
Reference in a new issue