https://github.com/botblock/golist
A GoLang library for posting server count to the BotBlock API. [GoLang - Maintained @scientific-dev]
https://github.com/botblock/golist
botblock golang golist wrapper
Last synced: 10 months ago
JSON representation
A GoLang library for posting server count to the BotBlock API. [GoLang - Maintained @scientific-dev]
- Host: GitHub
- URL: https://github.com/botblock/golist
- Owner: botblock
- License: mit
- Created: 2021-02-26T12:15:51.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-16T05:34:45.000Z (about 5 years ago)
- Last Synced: 2025-05-15T23:11:15.648Z (12 months ago)
- Topics: botblock, golang, golist, wrapper
- Language: Go
- Homepage: https://pkg.go.dev/github.com/botblock/golist
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Golist
Golist is an easy to use botblock api wrapper written in golang!
## Installation
```
go get github.com/botblock/golist
```
## Getting started
You can view the basic documentation of the package at [pkg.go.dev](https://pkg.go.dev/github.com/botblock/golist)!
```go
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)
}
}
```
### Creating a client with default properties
```go
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)
}
```
### Post Stats
```go
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!
```
### Get Bot
```go
bot, err := client.GetBot("bot id") // Returns the bot information
```
### Get lists
```go
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
```
## Support and Issues
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!