Skip to content

dlist-top/client-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Reference

DList.top Go client

Official dlist.top gateway client for Go.

Installation

go get github.com/dlist-top/client-go

Setup

To get your token please refer to the DList.top documentation.

Example code

package main

import (
	"context"
	"log"

	dlist "github.com/dlist-top/client-go"
)

func main() {
	c := dlist.NewClient("YOUR_API_TOKEN")
	if err := c.Connect(context.Background()); err != nil {
		panic(err)
	}

	c.OnVote(func(data dlist.VoteData) {
		log.Printf("%v voted for our bot / server. Total: %v", data.UserID, data.TotalVotes)
	})

	<-make(chan bool)
}

Notice: You can have up to 2 connections (per token) at the same time.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages