Skip to content
This repository has been archived by the owner on Aug 27, 2020. It is now read-only.

tatsuworks/tatsumaki-go

Repository files navigation

Tatsumaki Go

CircleCI Code Quality Documentation GitHub release (latest by date) Discord

A Go wrapper for Tatsumaki's external API.

If you have any queries about the API or this wrapper, please visit the api channel in our official support server.

How do I get an API key

To get an API key, run the following command with Tatsumaki in a server: t!apikey

Tutorial

To use the lib, first create an instance of the Tatsumaki client which will be your interface to interact with the API.

Then, call your desired endpoint methods on the client.

// Create client.
tatsumakiClient := tatsumakigo.New("YOUR API TOKEN")

// Get a user.
user, err := tatsumakiClient.User("User ID")

if err == nil {
	// Do stuff with the user response here.
	fmt.Println("User's required XP until next level up: %d", user.LevelProgress.RequiredXp)
}
...
// Get a user using a context.
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
user, err = tatsumakiClient.UserWithContext(ctx, "User ID")
...

License

Copyright ©2019 Tatsu Works.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.