This commit is contained in:
Morgan Bazalgette
2017-01-14 18:42:10 +01:00
parent 41ee4c90b3
commit 3961e310b1
444 changed files with 179208 additions and 0 deletions

24
vendor/github.com/thehowl/go-osuapi/get_user_recent.go generated vendored Normal file
View File

@@ -0,0 +1,24 @@
package osuapi
import (
"encoding/json"
"errors"
)
// GetUserRecent makes a get_user_recent request to the osu! API.
func (c Client) GetUserRecent(opts GetUserScoresOpts) ([]GUSScore, error) {
if opts.UserID == 0 && opts.Username == "" {
return nil, errors.New("osuapi: must have either UserID or Username in GetUserScoresOpts")
}
rawData, err := c.makerq("get_user_recent", opts.toValues())
if err != nil {
return nil, err
}
scores := []GUSScore{}
err = json.Unmarshal(rawData, &scores)
if err != nil {
return nil, err
}
return scores, nil
}