subscribe-bot/osuapi/users.go

29 lines
498 B
Go
Raw Normal View History

2020-10-15 14:39:54 +00:00
package osuapi
import "fmt"
func (api *Osuapi) GetUser(userId string) (user User, err error) {
url := fmt.Sprintf("/users/%s", userId)
err = api.Request("GET", url, &user)
if err != nil {
return
}
return
}
func (api *Osuapi) GetUserEvents(userId int, limit int, offset int) (events []Event, err error) {
url := fmt.Sprintf(
"/users/%d/recent_activity?limit=%d&offset=%d",
userId,
limit,
offset,
)
err = api.Request("GET", url, &events)
if err != nil {
return
}
return
}