Golist is an easy to use botblock api wrapper written in golang!
go get github.com/botblock/golist
You can view the basic documentation of the package at pkg.go.dev!
package main
import (
"fmt"
"github.com/botblock/golist"
)
func main(){
client := golist.Client{
map[string]string{
"botsfordiscord.com": "token",
"top.gg": "token",
}
}
res, err := client.PostStats("bot id", golist.Stats{
ServerCount: 20,
})
if err != nil{
fmt.Println(err.Error())
} else {
fmt.Println(res)
}
}
client := golist.NewClient() // This method returns the Client struct with default properties!
client.AddToken("top.gg", "token")
res, err := client.PostStats("bot id", golist.Stats{
ServerCount: 20,
})
if err != nil{
fmt.Println(err.Error())
} else {
fmt.Println(res)
}
res, err := client.PostStats("bot id", golist.Stats{
ServerCount: 20,
ShardID: 123,
ShardCount: 1,
Shards: []int64{1, 2, 3, 4},
}) // Post stats and returns PostResponse struct!
bot, err := client.GetBot("bot id") // Returns the bot information
lists, err := client.GetAllLists() // Returns an map of key with botlist id and value with list
list, err := client.GetList("list id"); // Return one paticualr list by id
ids, err := client.GetLegacyIDS(); // Returns the legacy ids of botlists registered on botblock
Incase, if you have any kind of doubt in using this package, open an issue in the github repo! This project is license under MIT License!