Animal Crossing: New Horizons API wrapper.
$ go get github.com/dqn/acnh
package main
import (
"fmt"
"github.com/dqn/acnh"
"github.com/dqn/gonso"
)
func main() {
accessToken, _ := gonso.Auth("SESSION_TOKEN")
a, err := acnh.New(accessToken)
if err != nil {
// Handle error.
}
r, err := a.Users()
if err != nil {
// Handle error.
}
for _, user := range r.Users {
fmt.Println(user)
}
}
You can get session token and access token by using gonso.
func New(accessToken string) *ACNH
New ACNH Client.
func (a *ACNH) Users() UsersResponse
Get all land users.
func (a *ACNH) AuthToken(userID string) AuthTokenResponse
Get token for user.
func (a *ACNH) UserProfile(token, userID string) UserProfileResponse
Get user profile.
func (a *ACNH) LandProfile(token, landID string) LandProfileResponse
Get land profile.
func (a *ACNH) Friends(token string) FriendsResponse
Get friends.
func (a *ACNH) PresenceFriends(token string) PresenceFriendsResponse
Get online friends.
func (a *ACNH) SendMessageAll(token, message string) SendMessageResponse
Send message to all friends.
func (a *ACNH) SendMessageFriend(token, userID, message string) SendMessageResponse
Send message to a friend.
func (a *ACNH) SendMessageLocal(token, message string) SendMessageResponse
Send message local.
See type.go.
MIT