users.go 350 B

123456789101112131415161718
  1. package amo
  2. import "surdeus.su/core/ss/urlenc"
  3. import "surdeus.su/core/amo/users"
  4. import "fmt"
  5. func (client *Client) GetUser(
  6. userId int,
  7. opts ...urlenc.Builder,
  8. ) (*users.User, error) {
  9. user := new(users.User)
  10. err := client.API.Get(fmt.Sprintf(
  11. "/api/v4/users/%d?%s",
  12. userId,
  13. urlenc.Join(opts...).Encode(),
  14. ), user)
  15. return user, err
  16. }