Giter Club home page Giter Club logo

golist's Introduction

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!

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

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

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

bot, err := client.GetBot("bot id") // Returns the bot information

Get lists

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!

golist's People

Contributors

jacobmitchell04 avatar scientific-dev avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.