Don't break the API.

This commit is contained in:
Chris Rhodes 2016-05-14 09:50:37 -07:00
parent 544d1dfcb5
commit a8ecc78c34
2 changed files with 11 additions and 3 deletions

View file

@ -216,7 +216,7 @@ func TestOpenClose(t *testing.T) {
// UpdateStatus - maybe we move this into wsapi_test.go but the websocket // UpdateStatus - maybe we move this into wsapi_test.go but the websocket
// created here is needed. This helps tests that the websocket was setup // created here is needed. This helps tests that the websocket was setup
// and it is working. // and it is working.
if err = d.UpdateStatus(0, time.Now().String(), ""); err != nil { if err = d.UpdateStatus(0, time.Now().String()); err != nil {
t.Errorf("UpdateStatus error: %+v", err) t.Errorf("UpdateStatus error: %+v", err)
} }

View file

@ -316,12 +316,12 @@ type updateStatusOp struct {
Data updateStatusData `json:"d"` Data updateStatusData `json:"d"`
} }
// UpdateStatus is used to update the user's status. // UpdateStreamingStatus is used to update the user's streaming status.
// If idle>0 then set status to idle. // If idle>0 then set status to idle.
// If game!="" then set game. // If game!="" then set game.
// If game!="" and url!="" then set the status type to streaming with the URL set. // If game!="" and url!="" then set the status type to streaming with the URL set.
// if otherwise, set status to active, and no game. // if otherwise, set status to active, and no game.
func (s *Session) UpdateStatus(idle int, game string, url string) (err error) { func (s *Session) UpdateStreamingStatus(idle int, game string, url string) (err error) {
s.log(LogInformational, "called") s.log(LogInformational, "called")
@ -355,6 +355,14 @@ func (s *Session) UpdateStatus(idle int, game string, url string) (err error) {
return return
} }
// UpdateStatus is used to update the user's status.
// If idle>0 then set status to idle.
// If game!="" then set game.
// if otherwise, set status to active, and no game.
func (s *Session) UpdateStatus(idle int, game string) (err error) {
return s.UpdateStreamingStatus(idle, game, "")
}
// onEvent is the "event handler" for all messages received on the // onEvent is the "event handler" for all messages received on the
// Discord Gateway API websocket connection. // Discord Gateway API websocket connection.
// //